コード例 #1
0
    def test_filter(self):
        """ The 7sur7.be frontpage items filter can separate photoalbum and video urls from regular news items from regular news items. """
        frontpage_items = [self.photoalbum_item, self.article_item, self.video_item]

        expected_news, expected_junk = [self.article_item], [self.photoalbum_item, self.video_item]
        observed_news, observed_junk = separate_articles_and_photoalbums(frontpage_items)

        eq_(expected_news, observed_news)
        eq_(expected_junk, observed_junk)
コード例 #2
0
    def test_nothing_to_filter(self):
        """ The 7sur7.be frontpage items filter does nothing to a list of urls with no photoalbum or video. """
        frontpage_items = [self.article_item]

        expected_news, expected_junk = [self.article_item], []
        observed_news, observed_junk = separate_articles_and_photoalbums(frontpage_items)

        eq_(expected_news, observed_news)
        eq_(expected_junk, observed_junk)