Ejemplo n.º 1
0
    def test_is_active(self):
        """
        Test is_active
        """
        test_cases = {
            (False, False): False,
            (False, None): False,
            (False, True): False,
            (None, False): False,
            (None, None): False,
            (None, True): False,
            (True, False): False,
            (True, None): False,
            (True, True): True,
        }

        for ((use_nzb, enabled), result) in six.iteritems(test_cases):
            sickbeard.USE_NZBS = use_nzb

            provider = NZBProvider('Test Provider')
            provider.enabled = enabled

            self.assertEqual(provider.is_active, result)
Ejemplo n.º 2
0
    def test_is_active(self):
        """
        Test is_active
        """
        test_cases = {
            (False, False): False,
            (False, None): False,
            (False, True): False,
            (None, False): False,
            (None, None): False,
            (None, True): False,
            (True, False): False,
            (True, None): False,
            (True, True): True,
        }

        for ((use_nzb, enabled), result) in test_cases.items():
            settings.USE_NZBS = use_nzb

            provider = NZBProvider("Test Provider")
            provider.enabled = enabled

            assert provider.is_active == result