diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-05-05 15:16:54 +0000 |
---|---|---|
committer | Baserock Gerrit <gerrit@baserock.org> | 2015-05-22 15:07:43 +0000 |
commit | 05b2b062afa2ab4cbd504735fd16cf53d969a2a5 (patch) | |
tree | 67ef311dde7af51353b18823736dbcbf19882162 /morphlib/gitdir_tests.py | |
parent | 538780673002b49aa1193e3617c81024ba64e434 (diff) | |
download | morph-05b2b062afa2ab4cbd504735fd16cf53d969a2a5.tar.gz |
Move 'git config' wrapper into its own class
We use 'git config' format config files outside Git repos, so it's
useful to have a helper class independent of the GitDirectory class.
This allows us to use it in the sysbranchdir.open() function to remove
a hack.
Change-Id: Ifa5e87f404d10666c98b9469079b7925d16becf6
Diffstat (limited to 'morphlib/gitdir_tests.py')
-rw-r--r-- | morphlib/gitdir_tests.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/morphlib/gitdir_tests.py b/morphlib/gitdir_tests.py index f606dfe7..0eafc0e8 100644 --- a/morphlib/gitdir_tests.py +++ b/morphlib/gitdir_tests.py @@ -90,6 +90,13 @@ class GitDirectoryTests(unittest.TestCase): gitdir.set_config('foo.bar', 'yoyo') self.assertEqual(gitdir.get_config('foo.bar'), 'yoyo') + def test_sets_and_gets_configuration_from_file(self): + gitdir = self.empty_git_directory() + config = morphlib.gitdir.Config( + config_file=os.path.join(gitdir.dirname, '.git', 'config')) + config['foo.bar'] = 'yoyo' + self.assertEqual(config['foo.bar'], 'yoyo') + def test_gets_index(self): gitdir = self.empty_git_directory() self.assertIsInstance(gitdir.get_index(), morphlib.gitindex.GitIndex) |