##// END OF EJS Templates
tests: add repository size tests
domruf -
r5770:43d23fa8 stable
parent child Browse files
Show More
@@ -376,6 +376,22 b' class GitChangesetTest(unittest.TestCase'
376 for revision, path, size in to_check:
376 for revision, path, size in to_check:
377 self._test_file_size(revision, path, size)
377 self._test_file_size(revision, path, size)
378
378
379 def _test_dir_size(self, revision, path, size):
380 node = self.repo.get_changeset(revision).get_node(path)
381 self.assertEqual(node.size, size)
382
383 def test_dir_size(self):
384 to_check = (
385 ('5f2c6ee195929b0be80749243c18121c9864a3b3', '/', 674076),
386 ('7ab37bc680b4aa72c34d07b230c866c28e9fc204', '/', 674049),
387 ('6892503fb8f2a552cef5f4d4cc2cdbd13ae1cd2f', '/', 671830),
388 )
389 for revision, path, size in to_check:
390 self._test_dir_size(revision, path, size)
391
392 def test_repo_size(self):
393 self.assertEqual(self.repo.size, 1022026) # FIXME
394
379 def test_file_history(self):
395 def test_file_history(self):
380 # we can only check if those revisions are present in the history
396 # we can only check if those revisions are present in the history
381 # as we cannot update this test every time file is changed
397 # as we cannot update this test every time file is changed
@@ -339,6 +339,23 b' class MercurialChangesetTest(unittest.Te'
339 for revision, path, size in to_check:
339 for revision, path, size in to_check:
340 self._test_file_size(revision, path, size)
340 self._test_file_size(revision, path, size)
341
341
342 def _test_dir_size(self, revision, path, size):
343 node = self.repo.get_changeset(revision).get_node(path)
344 self.assertFalse(node.is_file())
345 self.assertEqual(node.size, size)
346
347 def test_dir_size(self):
348 to_check = (
349 ('96507bd11ecc', '/', 682421),
350 ('a53d9201d4bc', '/', 682410),
351 ('90243de06161', '/', 682006),
352 )
353 for revision, path, size in to_check:
354 self._test_dir_size(revision, path, size)
355
356 def test_repo_size(self):
357 self.assertEqual(self.repo.size, 1042958) # FIXME
358
342 def test_file_history(self):
359 def test_file_history(self):
343 # we can only check if those revisions are present in the history
360 # we can only check if those revisions are present in the history
344 # as we cannot update this test every time file is changed
361 # as we cannot update this test every time file is changed
General Comments 0
You need to be logged in to leave comments. Login now