diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-18 14:25:14 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-18 14:25:14 +0200 |
commit | 225999e9442c746333a8baa17a6dbf7341c135ca (patch) | |
tree | 82e4bdf8a59fae869bae41aa6b9b048fee2d3e09 /test/git/test_repo.py | |
parent | 919164df96d9f956c8be712f33a9a037b097745b (diff) | |
parent | 9acc7806d6bdb306a929c460437d3d03e5e48dcd (diff) | |
download | gitpython-225999e9442c746333a8baa17a6dbf7341c135ca.tar.gz |
Merge branch 'diffing' into improvements
* diffing:
DiffIndex implemented including test
diff: implemented raw diff parsing which appears to be able to handle possible input types, DiffIndex still requires implementation though
resolved cyclic inclusion issue by moving the Diffable interface into the diff module, which probably is the right thing to do anyway
repo: fixed untracked files function which used git-commit before, it can open vim to get a message though which makes the program appear to freeze - using git-status now
implemented diff tests, but will have to move the diff module as it needs to create objects, whose import would create a dependency cycle
Removed a few diff-related test cases that fail now as the respective method is missing - these tests have to be redone in test-diff module accordingly
added Diffable interface to objects.base, its used by Commit and Tree objects.
Fixed object bug that would cause object ids not to be resolved to sha's as this was assumed - now there is a test for it as well
Diffstat (limited to 'test/git/test_repo.py')
-rw-r--r-- | test/git/test_repo.py | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/test/git/test_repo.py b/test/git/test_repo.py index 250974a5..87332067 100644 --- a/test/git/test_repo.py +++ b/test/git/test_repo.py @@ -43,7 +43,7 @@ class TestRepo(object): git.return_value = ListProcessAdapter(fixture('rev_list')) commits = list( self.repo.iter_commits('master', max_count=10) ) - + c = commits[0] assert_equal('4c8124ffcf4039d292442eeccabdeca5af5c5017', c.id) assert_equal(["634396b2f541a9f2d58b00be1a07f0c358b999b3"], [p.id for p in c.parents]) @@ -116,40 +116,6 @@ class TestRepo(object): { 'template': '/awesome'})) assert_true(repo.called) - @patch_object(Git, '_call_process') - def test_diff(self, git): - self.repo.diff('master^', 'master') - - assert_true(git.called) - assert_equal(git.call_args, (('diff', 'master^', 'master', '--'), {})) - - self.repo.diff('master^', 'master', 'foo/bar') - - assert_true(git.called) - assert_equal(git.call_args, (('diff', 'master^', 'master', '--', 'foo/bar'), {})) - - self.repo.diff('master^', 'master', 'foo/bar', 'foo/baz') - - assert_true(git.called) - assert_equal(git.call_args, (('diff', 'master^', 'master', '--', 'foo/bar', 'foo/baz'), {})) - - @patch_object(Git, '_call_process') - def test_diff_with_parents(self, git): - git.return_value = fixture('diff_p') - - diffs = self.repo.commit_diff('master') - assert_equal(15, len(diffs)) - assert_true(git.called) - - def test_archive(self): - args = ( tuple(), (self.repo.heads[-1],),(None,"hello") ) - for arg_list in args: - ftmp = os.tmpfile() - self.repo.archive(ftmp, *arg_list) - ftmp.seek(0,2) - assert ftmp.tell() - # END for each arg-list - @patch('git.utils.touch') def test_enable_daemon_serve(self, touch): self.repo.daemon_serve = False @@ -199,6 +165,9 @@ class TestRepo(object): assert_equal(self.repo.active_branch.name, 'major-refactoring') assert_equal(git.call_args, (('symbolic_ref', 'HEAD'), {})) + def test_head(self): + assert self.repo.head.object == self.repo.active_branch.object + @patch_object(Git, '_call_process') def test_should_display_blame_information(self, git): git.return_value = fixture('blame') |