annotate tests/test_binaryfiles.py @ 872:a279b5838aaf

test_util: remove self.repo_path, generate new paths each time This solves a problem with startrev tests sporadically failing in ra.get_log() with some kind of svn corruption error. Loading each svn repository in a different place solved that, or at least prevented me from reproducing it. What is interesting is this is the same fixture being loaded each time. Also, before loading the fixture, we take care of removing an existing repository. Loading with the same options twice also failed reproducing the issue. Same thing if the first load only load the svn repository but does not convert it. So, I have absolutely no idea what was wrong, blame python subprocess, subversion or some kind of filesystem write ordering bug.
author Patrick Mezard <patrick@mezard.eu>
date Thu, 19 Apr 2012 18:29:32 +0200
parents 312b37bc5e20
children d741f536f23a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
169
f1919e1c35bf fetch_command: cancel patching when encountering binary diffs
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
1 import test_util
f1919e1c35bf fetch_command: cancel patching when encountering binary diffs
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
2
643
d2ef7220a079 tests: import test_util as the first module in all relevant tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 195
diff changeset
3 import unittest
d2ef7220a079 tests: import test_util as the first module in all relevant tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 195
diff changeset
4
169
f1919e1c35bf fetch_command: cancel patching when encountering binary diffs
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
5 class TestFetchBinaryFiles(test_util.TestBase):
f1919e1c35bf fetch_command: cancel patching when encountering binary diffs
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
6 def test_binaryfiles(self, stupid=False):
f1919e1c35bf fetch_command: cancel patching when encountering binary diffs
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
7 repo = self._load_fixture_and_fetch('binaryfiles.svndump', stupid=stupid)
f1919e1c35bf fetch_command: cancel patching when encountering binary diffs
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
8 self.assertEqual('cce7fe400d8d', str(repo['tip']))
f1919e1c35bf fetch_command: cancel patching when encountering binary diffs
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
9
f1919e1c35bf fetch_command: cancel patching when encountering binary diffs
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
10 def test_binaryfiles_stupid(self):
f1919e1c35bf fetch_command: cancel patching when encountering binary diffs
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
11 self.test_binaryfiles(True)
f1919e1c35bf fetch_command: cancel patching when encountering binary diffs
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
12
f1919e1c35bf fetch_command: cancel patching when encountering binary diffs
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
13 def suite():
833
312b37bc5e20 tests: avoid shadowing Python builtin all()
Yonggang Luo <luoyonggang@gmail.com>
parents: 643
diff changeset
14 all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestFetchBinaryFiles),
169
f1919e1c35bf fetch_command: cancel patching when encountering binary diffs
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
15 ]
833
312b37bc5e20 tests: avoid shadowing Python builtin all()
Yonggang Luo <luoyonggang@gmail.com>
parents: 643
diff changeset
16 return unittest.TestSuite(all_tests)