Changeset - a455353077c8
[Not reviewed]
default
0 1 0
Mads Kiilerich - 6 years ago 2020-02-05 23:04:27
mads@kiilerich.com
py3: automatic migration with 2to3 -f asserts
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/vcs/test_git.py
Show inline comments
 
@@ -322,49 +322,49 @@ class TestGitChangeset(object):
 
        assert chset44.branch is None # should be 'web-branch'?
 
        assert chset44.branches == [] # should be 'web-branch'?
 

	
 
        tip = self.repo.get_changeset('tip')
 
        assert 'tip' not in tip.tags # it should be?
 
        assert not tip.tags # how it is!
 

	
 
    def _test_slices(self, limit, offset):
 
        count = self.repo.count()
 
        changesets = self.repo.get_changesets(limit=limit, offset=offset)
 
        idx = 0
 
        for changeset in changesets:
 
            rev = offset + idx
 
            idx += 1
 
            rev_id = self.repo.revisions[rev]
 
            if idx > limit:
 
                pytest.fail("Exceeded limit already (getting revision %s, "
 
                    "there are %s total revisions, offset=%s, limit=%s)"
 
                    % (rev_id, count, offset, limit))
 
            assert changeset == self.repo.get_changeset(rev_id)
 
        result = list(self.repo.get_changesets(limit=limit, offset=offset))
 
        start = offset
 
        end = limit and offset + limit or None
 
        sliced = list(self.repo[start:end])
 
        pytest.failUnlessEqual(result, sliced,
 
        pytest.assertEqual(result, sliced,
 
            msg="Comparison failed for limit=%s, offset=%s"
 
            "(get_changeset returned: %s and sliced: %s"
 
            % (limit, offset, result, sliced))
 

	
 
    def _test_file_size(self, revision, path, size):
 
        node = self.repo.get_changeset(revision).get_node(path)
 
        assert node.is_file()
 
        assert node.size == size
 

	
 
    def test_file_size(self):
 
        to_check = (
 
            ('c1214f7e79e02fc37156ff215cd71275450cffc3',
 
                'vcs/backends/BaseRepository.py', 502),
 
            ('d7e0d30fbcae12c90680eb095a4f5f02505ce501',
 
                'vcs/backends/hg.py', 854),
 
            ('6e125e7c890379446e98980d8ed60fba87d0f6d1',
 
                'setup.py', 1068),
 
            ('d955cd312c17b02143c04fa1099a352b04368118',
 
                'vcs/backends/base.py', 2921),
 
            ('ca1eb7957a54bce53b12d1a51b13452f95bc7c7e',
 
                'vcs/backends/base.py', 3936),
 
            ('f50f42baeed5af6518ef4b0cb2f1423f3851a941',
 
                'vcs/backends/base.py', 6189),
 
        )
0 comments (0 inline, 0 general)