diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-19 15:04:04 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-19 15:04:04 +0200 |
commit | 8f42db54c6b2cfbd7d68e6d34ac2ed70578402f7 (patch) | |
tree | 1a0ce488e628df94f61048e1e9c691c59a83e867 /test/git/test_repo.py | |
parent | 657a57adbff49c553752254c106ce1d5b5690cf8 (diff) | |
parent | 26029c29765043376370a2877b7e635c17f5e76d (diff) | |
download | gitpython-8f42db54c6b2cfbd7d68e6d34ac2ed70578402f7.tar.gz |
Merge branch 'config' into improvements
* config:
added additional testing for the configuration, concurrent access and config reading, all tests work
implemented config class as far as necessary, one check is still failing
Added frame for configuration reader involving a meta class, decorators and tests - most of which still has to be filled out
Diffstat (limited to 'test/git/test_repo.py')
-rw-r--r-- | test/git/test_repo.py | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/test/git/test_repo.py b/test/git/test_repo.py index 87332067..0d8a473d 100644 --- a/test/git/test_repo.py +++ b/test/git/test_repo.py @@ -8,9 +8,11 @@ import os, sys from test.testlib import * from git import * -class TestRepo(object): - def setup(self): - self.repo = Repo(GIT_REPO) +class TestRepo(TestCase): + + @classmethod + def setUpAll(cls): + cls.repo = Repo(GIT_REPO) @raises(InvalidGitRepositoryError) def test_new_should_raise_on_invalid_repo_location(self): @@ -219,3 +221,18 @@ class TestRepo(object): # END handle files assert len(self.repo.untracked_files) == (num_recently_untracked - len(files)) + + def test_config_reader(self): + reader = self.repo.config_reader + assert reader.read_only + + def test_config_writer(self): + for config_level in self.repo.config_level: + try: + writer = self.repo.config_writer(config_level) + assert not writer.read_only + except IOError: + # its okay not to get a writer for some configuration files if we + # have no permissions + pass + # END for each config level |