示例#1
0
    def test_empty_feed_empty_entry(self):
        feed = {}
        entry = {}
        expected = True

        result = feeds.test_filters(feed, entry)
        self.assertEquals(result, expected)
示例#2
0
    def test_no_anime_name(self):
        feed = {"anime": "test"}
        entry = {"subber": u"Commie", "episode": 3, "resolution": u"720p", "extension": u"mkv"}
        expected = False

        result = feeds.test_filters(feed, entry)
        self.assertEquals(result, expected)
示例#3
0
    def test_resolution_no_resolution(self):
        feed = {"resolution": "720p"}
        entry = {"subber": u"Commie", "anime": u"Sword Art Online", "episode": 3, "extension": u"mkv"}
        expected = False

        result = feeds.test_filters(feed, entry)
        self.assertEquals(result, expected)
示例#4
0
    def test_min_episode_floating_point_episode_number_under_min(self):
        feed = {"min_episode": 2}
        entry = {"subber": u"Commie", "anime": u"Sword Art Online", "episode": 1.5, "extension": u"mkv"}
        expected = False

        result = feeds.test_filters(feed, entry)
        self.assertEquals(result, expected)
示例#5
0
    def test_min_episode_over_minimum(self):
        feed = {"min_episode": 2}
        entry = {"subber": u"Commie", "anime": u"Sword Art Online", "episode": 3, "extension": u"mkv"}
        expected = True

        result = feeds.test_filters(feed, entry)
        self.assertEquals(result, expected)
示例#6
0
    def test_two_criteria(self):
        feed = {"resolution": "720p", "min_episode": 2}
        entry = {
            "subber": u"Commie",
            "anime": u"Sword Art Online",
            "episode": 2,
            "resolution": u"720p",
            "extension": u"mkv",
        }
        expected = True

        result = feeds.test_filters(feed, entry)
        self.assertEquals(result, expected)
示例#7
0
    def test_right_anime_name(self):
        feed = {"anime": "Sword Art Online"}
        entry = {
            "subber": u"Commie",
            "anime": u"Sword Art Online",
            "episode": 3,
            "resolution": u"720p",
            "extension": u"mkv",
        }
        expected = True

        result = feeds.test_filters(feed, entry)
        self.assertEquals(result, expected)