diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-20 11:17:39 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-20 11:17:39 +0200 |
commit | 35a09c0534e89b2d43ec4101a5fb54576b577905 (patch) | |
tree | b2f45485ba021a23e41285fef944f64407356dd9 /test/git/test_repo.py | |
parent | 972a8b84bb4a3adec6322219c11370e48824404e (diff) | |
download | gitpython-35a09c0534e89b2d43ec4101a5fb54576b577905.tar.gz |
repo.alternates test cheked for correctness and bugfixed - totally mocked tests bare the risk that things do not work properly outside of the sandbox.
Diffstat (limited to 'test/git/test_repo.py')
-rw-r--r-- | test/git/test_repo.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/test/git/test_repo.py b/test/git/test_repo.py index c89bcde3..bc2c7094 100644 --- a/test/git/test_repo.py +++ b/test/git/test_repo.py @@ -142,17 +142,15 @@ class TestRepo(TestCase): self.repo.daemon_export = orig_val assert self.repo.daemon_export == orig_val - @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') |