diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-19 18:53:55 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-19 18:53:55 +0200 |
commit | 048acc4596dc1c6d7ed3220807b827056cb01032 (patch) | |
tree | 448259c37aa52e7bada2ec6c642160ee99c21670 /test/git/test_remote.py | |
parent | a07cdbae1d485fd715a5b6eca767f211770fea4d (diff) | |
download | gitpython-048acc4596dc1c6d7ed3220807b827056cb01032.tar.gz |
Added configuration access including tests to remote
config: fixed issue that would cause it to abort reading if the file did not exist - this is valid now
Test does not work as the configuration parsing does not work as expected - this must be fixed first
Diffstat (limited to 'test/git/test_remote.py')
-rw-r--r-- | test/git/test_remote.py | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/test/git/test_remote.py b/test/git/test_remote.py index 6d6fcea6..24fba07c 100644 --- a/test/git/test_remote.py +++ b/test/git/test_remote.py @@ -19,7 +19,7 @@ class TestRemote(TestCase): num_remotes += 1 assert str(remote) != repr(remote) - + # REFS refs = remote.refs assert refs for ref in refs: @@ -27,7 +27,28 @@ class TestRemote(TestCase): assert ref.remote_branch # END for each ref - # test rename + # OPTIONS + for opt in ("url", "fetch"): + val = getattr(remote, opt) + reader = remote.config_reader + assert reader.get(opt) == val + + # unable to write with a reader + self.failUnlessRaises(IOError, reader.set, opt, "test") + + # change value + writer = remote.config_writer + new_val = "myval" + writer.set(opt, new_val) + assert writer.get(opt) == new_val + writer.set(opt, val) + assert writer.get(opt) == val + del(writer) + assert getattr(remote, opt) == val + # END + self.fail( "option testing, read/write" ) + + # RENAME other_name = "totally_other_name" prev_name = remote.name assert remote.rename(other_name) == remote |