Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfc843d3

Browse files
committed
Add test asserting that get_values works by itself
As described in#1534, this test will fail in main with a KeyErrorabout a missing section name even though the named sections do existwithin the config file.This test will pass in the branch associated with#1535. This testshould keep the improved behavior healthy as the code evolves bypreventing future developers from removing the eager loading ofsections within get_values().
1 parentcfc613a commitfc843d3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎test/test_config.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,17 @@ def test_empty_config_value(self):
398398
withself.assertRaises(cp.NoOptionError):
399399
cr.get_value("color","ui")
400400

401+
deftest_get_values_works_without_requiring_any_other_calls_first(self):
402+
file_obj=self._to_memcache(fixture_path("git_config_multiple"))
403+
cr=GitConfigParser(file_obj,read_only=True)
404+
self.assertEqual(cr.get_values("section0","option0"), ["value0"])
405+
file_obj.seek(0)
406+
cr=GitConfigParser(file_obj,read_only=True)
407+
self.assertEqual(cr.get_values("section1","option1"), ["value1a","value1b"])
408+
file_obj.seek(0)
409+
cr=GitConfigParser(file_obj,read_only=True)
410+
self.assertEqual(cr.get_values("section1","other_option1"), ["other_value1"])
411+
401412
deftest_multiple_values(self):
402413
file_obj=self._to_memcache(fixture_path("git_config_multiple"))
403414
withGitConfigParser(file_obj,read_only=False)ascw:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp