def test_main_help_module_subcommand_and_invalid(self):
"""
Test help output for an arg that does not match any condition as well as the 'list' subcommand
and the 'arpcache' module.
"""
sys.argv = ["ec2rl", "help", "doesnotmatchanything", "arpcache", "list", ]
with contextlib.redirect_stdout(self.output):
self.assertTrue(self.ec2rl.help())
# Check that the length of the help message matches the expected value
self.assertEqual(len(self.output.getvalue()), 595)
self.assertTrue(self.output.getvalue().startswith("arpcache:\nDetermines if aggressive arp caching is enabled"))
self.assertTrue(self.output.getvalue().endswith(" specified comma delimited list\n\n\n"))
评论列表
文章目录