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

Method test_aliases_help_msg

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

Source from the content-addressed store, hash-verified

383 self.assertEqual(app.foo, 5)
384
385 def test_aliases_help_msg(self):
386 app = MyApp()
387 stdout = io.StringIO()
388 with contextlib.redirect_stdout(stdout):
389 app.print_alias_help()
390 hmsg = stdout.getvalue()
391 self.assertRegex(hmsg, "(?<!-)-i, --fooi\\b")
392 self.assertRegex(hmsg, "(?<!-)-j, --fooj\\b")
393 self.assertIn("Equivalent to: [--Foo.i]", hmsg)
394 self.assertIn("Equivalent to: [--Foo.j]", hmsg)
395 self.assertIn("Equivalent to: [--Foo.name]", hmsg)
396
397 def test_alias_unrecognized(self):
398 """Check ability to override handling for unrecognized aliases"""

Callers

nothing calls this directly

Calls 2

print_alias_helpMethod · 0.80
MyAppClass · 0.70

Tested by

no test coverage detected