From 4106f183ad0875734ba2c697570f9fd272970804 Mon Sep 17 00:00:00 2001 From: "A. Jesse Jiryu Davis" Date: Mon, 21 Jan 2019 09:38:51 -0500 Subject: Use items and items_all correctly #717 --- git/test/test_config.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'git/test/test_config.py') 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']) -- cgit v1.2.3