Exemple #1
0
    def test_get_actions(self):
        """
        Tests whether or not the different kinds of actions an episode can have are returned correctly
        """
        test_cases = {
            None: [],
            '': [],
            'wrong': [],
            'downloaded': Quality.DOWNLOADED,
            'Downloaded': Quality.DOWNLOADED,
            'snatched': Quality.SNATCHED,
            'Snatched': Quality.SNATCHED,
        }

        unicode_test_cases = {
            '': [],
            'wrong': [],
            'downloaded': Quality.DOWNLOADED,
            'Downloaded': Quality.DOWNLOADED,
            'snatched': Quality.SNATCHED,
            'Snatched': Quality.SNATCHED,
        }

        for tests in test_cases, unicode_test_cases:
            for (action, result) in six.iteritems(tests):
                self.assertEqual(History._get_actions(action), result)  # pylint: disable=protected-access
Exemple #2
0
    def test_get_actions(self):
        """
        Tests whether or not the different kinds of actions an episode can have are returned correctly
        """
        test_cases = {
            None: [],
            "": [],
            "wrong": [],
            "downloaded": Quality.DOWNLOADED,
            "Downloaded": Quality.DOWNLOADED,
            "snatched": Quality.SNATCHED,
            "Snatched": Quality.SNATCHED,
        }

        unicode_test_cases = {
            "": [],
            "wrong": [],
            "downloaded": Quality.DOWNLOADED,
            "Downloaded": Quality.DOWNLOADED,
            "snatched": Quality.SNATCHED,
            "Snatched": Quality.SNATCHED,
        }

        for tests in test_cases, unicode_test_cases:
            for (action, result) in tests.items():
                assert History._get_actions(action) == result