def test_print_whats_next(self):
profile = {
"name": factory.make_name("profile"),
"url": factory.make_name("url"),
}
stdout = self.patch(sys, "stdout", StringIO())
cli.cmd_login.print_whats_next(profile)
expected = dedent("""\
You are now logged in to the MAAS server at %(url)s
with the profile name '%(name)s'.
For help with the available commands, try:
maas %(name)s --help
""") % profile
observed = stdout.getvalue()
flags = doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE
self.assertThat(observed, DocTestMatches(expected, flags))
评论列表
文章目录