Skip to content

Commit 1c01b5d

Browse files
committed
Add unit test
1 parent ae5c426 commit 1c01b5d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_doit_cmd.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,19 @@ def test_merge_api_toml_config(self):
178178
assert main.config['foo'] == {'nval': 33}
179179
assert main.config['task:bar'] == {'opt': "baz"}
180180

181+
def test_merge_api_toml_config_with_prefix(self):
182+
config_filename = os.path.join(os.path.dirname(__file__), 'sample_with_prefix.toml')
183+
main = doit_cmd.DoitMain(config_filenames=config_filename,
184+
toml_config_files_prefix="tool.doit")
185+
assert 1 == len(main.config['COMMAND'])
186+
# test loaded plugin command is actually used with plugin name
187+
assert 'foo' in main.get_cmds()
188+
# INI has higher preference the api_config
189+
assert main.config['GLOBAL'] == {'optx':'6', 'opty':'7'}
190+
191+
assert main.config['foo'] == {'nval': 33}
192+
assert main.config['task:bar'] == {'opt': "baz"}
193+
181194

182195
def test_find_pyproject_toml_config(self):
183196
config_filename = os.path.join(os.path.dirname(__file__), 'pyproject.toml')

0 commit comments

Comments
 (0)