def test_main_list_nonapplicable_modules(self):
"""
Disable the "xennetrocket" module then test that the list subcommand returns True when complete and outputs
the expected number of characters.
"""
for module_obj in self.ec2rl._modules:
if module_obj.name == "xennetrocket":
module_obj.applicable = False
with contextlib.redirect_stdout(self.output):
self.assertTrue(self.ec2rl.list())
self.assertTrue(self.output.getvalue().startswith("Here is a list of available modules that apply to the curr"))
self.assertTrue(self.output.getvalue().endswith("=MODULEa ... MODULEx] [--only-domains=DOMAINa ... DOMAINx]\n"))
self.assertFalse(re.search(r"xennetrocket", self.output.getvalue()))
self.assertEqual(len(self.output.getvalue()), 14410)
评论列表
文章目录