diff options
author | A. Jesse Jiryu Davis <jesse@mongodb.com> | 2019-01-21 09:38:51 -0500 |
---|---|---|
committer | A. Jesse Jiryu Davis <jesse@mongodb.com> | 2019-01-21 10:09:40 -0500 |
commit | 4106f183ad0875734ba2c697570f9fd272970804 (patch) | |
tree | 85393df59990032913ef2ecf18b709ab9936a56e /git/test/test_config.py | |
parent | a26349d8df88107bd59fd69c06114d3b213d0b27 (diff) | |
download | gitpython-4106f183ad0875734ba2c697570f9fd272970804.tar.gz |
Use items and items_all correctly
#717
Diffstat (limited to 'git/test/test_config.py')
-rw-r--r-- | git/test/test_config.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/git/test/test_config.py b/git/test/test_config.py index 67e4810d..93f94748 100644 --- a/git/test/test_config.py +++ b/git/test/test_config.py @@ -11,7 +11,7 @@ from git import ( GitConfigParser ) from git.compat import string_types -from git.config import cp +from git.config import _OMD, cp from git.test.lib import ( TestCase, fixture_path, @@ -362,3 +362,13 @@ class TestBase(TestCase): self.assertEqual(cr.items_all('section1'), [('option1', ['value1a', 'value1b', 'value1c']), ('other_option1', ['other_value1'])]) + + def test_setlast(self): + # Test directly, not covered by higher-level tests. + omd = _OMD() + omd.setlast('key', 'value1') + self.assertEqual(omd['key'], 'value1') + self.assertEqual(omd.getall('key'), ['value1']) + omd.setlast('key', 'value2') + self.assertEqual(omd['key'], 'value2') + self.assertEqual(omd.getall('key'), ['value2']) |