summaryrefslogtreecommitdiff
path: root/test/git/test_repo.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-20 00:04:10 +0200
committerSebastian Thiel <byronimo@gmail.com>2009-10-20 00:04:10 +0200
commite64957d8e52d7542310535bad1e77a9bbd7b4857 (patch)
tree2bb93792907aa5119b2c9c8d665388f744c3e663 /test/git/test_repo.py
parent989671780551b7587d57e1d7cb5eb1002ade75b4 (diff)
downloadgitpython-e64957d8e52d7542310535bad1e77a9bbd7b4857.tar.gz
Improved is_dirty including test
Diffstat (limited to 'test/git/test_repo.py')
-rw-r--r--test/git/test_repo.py22
1 files changed, 10 insertions, 12 deletions
diff --git a/test/git/test_repo.py b/test/git/test_repo.py
index f9d81c69..7ad68414 100644
--- a/test/git/test_repo.py
+++ b/test/git/test_repo.py
@@ -160,19 +160,17 @@ class TestRepo(TestCase):
self.repo.bare = True
assert_false(self.repo.is_dirty)
- @patch_object(Git, '_call_process')
- def test_is_dirty_with_clean_working_dir(self, git):
- self.repo.bare = False
- git.return_value = ''
- assert_false(self.repo.is_dirty)
- assert_equal(git.call_args, (('diff', 'HEAD', '--'), {}))
-
- @patch_object(Git, '_call_process')
- def test_is_dirty_with_dirty_working_dir(self, git):
+ def test_is_dirty(self):
self.repo.bare = False
- git.return_value = '''-aaa\n+bbb'''
- assert_true(self.repo.is_dirty)
- assert_equal(git.call_args, (('diff', 'HEAD', '--'), {}))
+ for index in (0,1):
+ for working_tree in (0,1):
+ for untracked_files in (0,1):
+ assert self.repo.is_dirty in (True, False)
+ # END untracked files
+ # END working tree
+ # END index
+ self.repo.bare = True
+ assert self.repo.is_dirty == False
@patch_object(Git, '_call_process')
def test_active_branch(self, git):