def test_command_help_noargs(self): excepted_output = """ Use `next', `prev', `first', `last', `goto' and `random' to select comics. Use `display' to show comics' transcriptions. Use `display img' to display images (requires imagemagick and a running X server). Use `explain' to open the explain xkcd page for that comic. Use `update' to check for new comics. Use `save' to save comics to disk. Use `quit' or `exit' to exit. Use `help [command]' to get help.""" output = xkcd.command_help() self.assertEqual(output, excepted_output)
def test_command_help_nodoc(self): xkcd.commands["test"] = "Test!" output = xkcd.command_help("test") expected_output = "Command exists, but has no documentation." self.assertEqual(output, expected_output)
def test_command_help_uknowncommand(self): excepted_output = "Unknown command." output = xkcd.command_help("thisisnotarealcommand") self.assertEqual(output, excepted_output)
def test_command_help_progs(self): for command in xkcd.commands_help: excepted_output = xkcd.commands_help[command] output = xkcd.command_help(command) self.assertEqual(output, excepted_output)