MCPcopy Create free account
hub / github.com/ipython/traitlets / test_config_dict_args

Method test_config_dict_args

tests/config/test_application.py:212–230  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

210 assert app.bar.tb == ("AB",)
211
212 def test_config_dict_args(self):
213 app = MyApp()
214 app.parse_command_line(
215 "--Foo.fdict a=1 --Foo.fdict b=b --Foo.fdict c=3 "
216 "--Bar.bdict k=1 -D=a=b -D 22=33 "
217 "--Bar.idict k=1 --Bar.idict b=2 --Bar.idict c=3 ".split()
218 )
219 fdict = {"a": "1", "b": "b", "c": "3"}
220 bdict = {"k": "1", "a": "b", "22": "33"}
221 idict = {"k": 1, "b": 2, "c": 3}
222 config = app.config
223 assert config.Bar.idict == idict
224 self.assertDictEqual(config.Foo.fdict, fdict)
225 self.assertDictEqual(config.Bar.bdict, bdict)
226 app.init_foo()
227 self.assertEqual(app.foo.fdict, fdict)
228 app.init_bar()
229 assert app.bar.idict == idict
230 self.assertEqual(app.bar.bdict, bdict)
231
232 def test_config_propagation(self):
233 app = MyApp()

Callers

nothing calls this directly

Calls 4

init_fooMethod · 0.95
init_barMethod · 0.95
parse_command_lineMethod · 0.80
MyAppClass · 0.70

Tested by

no test coverage detected