diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-22 16:20:35 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-22 16:20:35 +0200 |
commit | 3c658c16f3437ed7e78f6072b6996cb423a8f504 (patch) | |
tree | 4dcb21b565410c48878be31deebbb441201d542b /test/git/test_diff.py | |
parent | 59e26435a8d2008073fc315bafe9f329d0ef689a (diff) | |
parent | b197b2dbb527de9856e6e808339ab0ceaf0a512d (diff) | |
download | gitpython-3c658c16f3437ed7e78f6072b6996cb423a8f504.tar.gz |
Merge branch 'testsystem' into improvements
* testsystem:
Adjusted all remaining test suites to use the new TestBase class where appropriate
Fixed decorator issue that would cause a function to be passed even though there is a default argument. This feels inconsistent as the 'argument passer' wrapper function can be called with a function or a string as first argument depending on whether the client code was explicitly passing an argument or not. That ... sucks. Now test for that case specifically and fail with a proper assertion error. I don't like it, but what can I do ... .
Implemented decorators, tests pass at least
Added frame for new Repo handling and some neat decorators, including tests that test whether the testing framework does what it should
Diffstat (limited to 'test/git/test_diff.py')
-rw-r--r-- | test/git/test_diff.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/test/git/test_diff.py b/test/git/test_diff.py index 501d937d..d7505987 100644 --- a/test/git/test_diff.py +++ b/test/git/test_diff.py @@ -7,19 +7,17 @@ from test.testlib import * from git import * -class TestDiff(TestCase): - def setUp(self): - self.repo = Repo(GIT_REPO) - +class TestDiff(TestBase): + def test_list_from_string_new_mode(self): output = ListProcessAdapter(fixture('diff_new_mode')) - diffs = Diff._index_from_patch_format(self.repo, output.stdout) + diffs = Diff._index_from_patch_format(self.rorepo, output.stdout) assert_equal(1, len(diffs)) assert_equal(10, len(diffs[0].diff.splitlines())) def test_diff_with_rename(self): output = ListProcessAdapter(fixture('diff_rename')) - diffs = Diff._index_from_patch_format(self.repo, output.stdout) + diffs = Diff._index_from_patch_format(self.rorepo, output.stdout) assert_equal(1, len(diffs)) @@ -37,13 +35,13 @@ class TestDiff(TestCase): for fixture_name in fixtures: diff_proc = ListProcessAdapter(fixture(fixture_name)) - diffs = Diff._index_from_patch_format(self.repo, diff_proc.stdout) + diffs = Diff._index_from_patch_format(self.rorepo, diff_proc.stdout) # END for each fixture def test_diff_interface(self): # test a few variations of the main diff routine assertion_map = dict() - for i, commit in enumerate(self.repo.iter_commits('0.1.6', max_count=10)): + for i, commit in enumerate(self.rorepo.iter_commits('0.1.6', max_count=10)): diff_item = commit if i%2 == 0: diff_item = commit.tree |