Exemple #1
0
 def test_changeset_info(self):
     crp = model.CodeReviewPool(self.env)
     correct_result = [(u'4', u'ada', u'No, too', u'/ringier/', 1161214323),
                       (u'2', u'cindy', u'It is ok', u'/branches',
                        1161098309),
                       (u'1', u'robert', u'#234', u'/trunk', 1160234353)]
     self.failUnlessEqual([i for i in crp.changeset_info([1, 2, 4])],
                          correct_result)
Exemple #2
0
 def test_get_codereviews_by_time(self):
     crp = model.CodeReviewPool(self.env)
     correct_result = [(1163094124, 'tc', 'mytest', 3, 1, 1, 'No'),
                       (1163243123, 'clark', 'no', 3, -1, 2, 'No'),
                       (1163364264, 'tony', 'hello2', 1, 1, 2, '#234')]
     self.failUnlessEqual(
         [i for i in crp.get_codereviews_by_time(1163000000, 1164000000)],
         correct_result)
Exemple #3
0
    def test_is_show(self):
        crp = model.CodeReviewPool(self.env)
        self.failUnless(crp._is_show(None, '/test', '#234'))

        crp = model.CodeReviewPool(self.env)
        self.failUnless(
            crp._is_show({'prefix': ['/test1', '/abc']}, '/test', '#234'))

        crp = model.CodeReviewPool(self.env)
        self.failUnlessEqual(
            crp._is_show({'prefix': ['/tes', '/abc']}, '/test', '#234'), False)

        crp = model.CodeReviewPool(self.env)
        self.failUnless(
            crp._is_show({'msg': ['#2345', '#34']}, '/test', '#234'))

        crp = model.CodeReviewPool(self.env)
        self.failUnlessEqual(
            crp._is_show({'msg': ['#23', '#34']}, '/test', '#234'), False)

        crp = model.CodeReviewPool(self.env)
        self.failUnless(
            crp._is_show({
                'prefix': ['/test1', '/abc'],
                'msg': [
                    '#2345',
                ]
            }, '/test', '#234'))

        crp = model.CodeReviewPool(self.env)
        self.failUnlessEqual(
            crp._is_show({
                'prefix': ['/tes', '/abc'],
                'msg': [
                    '#23',
                ]
            }, '/test', '#234'), False)

        crp = model.CodeReviewPool(self.env)
        self.failUnless(crp._is_show({'abc': 'def'}, '/test', '#234'))