MCPcopy Create free account
hub / github.com/ipython/ipython / test_simplenamespace

Function test_simplenamespace

IPython/lib/tests/test_pretty.py:410–427  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

408
409
410def test_simplenamespace():
411 SN = types.SimpleNamespace
412
413 sn_recursive = SN()
414 sn_recursive.first = sn_recursive
415 sn_recursive.second = sn_recursive
416 cases = [
417 (SN(), "namespace()"),
418 (SN(x=SN()), "namespace(x=namespace())"),
419 (SN(a_long_name=[SN(s=string.ascii_lowercase)]*3, a_short_name=None),
420 "namespace(a_long_name=[namespace(s='abcdefghijklmnopqrstuvwxyz'),\n"
421 " namespace(s='abcdefghijklmnopqrstuvwxyz'),\n"
422 " namespace(s='abcdefghijklmnopqrstuvwxyz')],\n"
423 " a_short_name=None)"),
424 (sn_recursive, "namespace(first=namespace(...), second=namespace(...))"),
425 ]
426 for obj, expected in cases:
427 nt.assert_equal(pretty.pretty(obj), expected)
428
429
430def test_pretty_environ():

Callers

nothing calls this directly

Calls 1

prettyMethod · 0.80

Tested by

no test coverage detected