summaryrefslogtreecommitdiff
path: root/test/git/test_repo.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-21 14:47:38 +0200
committerSebastian Thiel <byronimo@gmail.com>2009-10-21 14:47:38 +0200
commita2ec078f25eb357edd1912ca3dbd578979a51226 (patch)
treee475fd9bc73b141b52e3117f6650a512987636e5 /test/git/test_repo.py
parenta7f52745c95e5dd673a79a2281ccd7463ce00ffa (diff)
downloadgitpython-a2ec078f25eb357edd1912ca3dbd578979a51226.tar.gz
Fixed repo.alternates implementation which didn't work in the 'real' world with a non-mock test
Diffstat (limited to 'test/git/test_repo.py')
-rw-r--r--test/git/test_repo.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/test/git/test_repo.py b/test/git/test_repo.py
index 1c5b50d9..8927971a 100644
--- a/test/git/test_repo.py
+++ b/test/git/test_repo.py
@@ -207,17 +207,15 @@ class TestRepo(object):
self.repo.daemon_serve = True
assert_true(self.repo.daemon_serve)
- @patch_object(os.path, 'exists')
- def test_alternates_no_file(self, os):
- os.return_value = False
- assert_equal([], self.repo.alternates)
-
- assert_true(os.called)
-
- @patch_object(os, 'remove')
- def test_alternates_setter_empty(self, os):
+ def test_alternates(self):
+ cur_alternates = self.repo.alternates
+ # empty alternates
self.repo.alternates = []
- assert_true(os.called)
+ assert self.repo.alternates == []
+ alts = [ "other/location", "this/location" ]
+ self.repo.alternates = alts
+ assert alts == self.repo.alternates
+ self.repo.alternates = cur_alternates
def test_repr(self):
path = os.path.join(os.path.abspath(GIT_REPO), '.git')