NNTPSimpleFilter_Test.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:newsreap 作者: caronc 项目源码 文件源码
def test_scoring_video_files(self):
        """
        Test that we correctly score video files
        """

        sf = NNTPSimpleFilter()
        entry = copy(self.template_entry)

        # Expected Score
        score = 25

        # Test against video files:
        for e in [ 'avi', 'mpeg', 'mpg', 'mp4', 'mov', 'mkv', 'asf',
                  'ogg', 'iso', 'rm' ]:

            entry['subject'] = 'What.A.Great.Show (1/1) ' +\
                    '"what.a.great.show.%s" Yenc (1/1)' % e

            assert sf.score(**entry) == score

            # now test that we can support .??? extensions after
            # the initial one
            for i in range(1000):
                entry['subject'] = 'What.A.Great.Show (1/1) ' +\
                        '"what.a.great.show.%s.%.3d" Yenc (1/1)' % (e, i)
                assert sf.score(**entry) == score
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号