def test_help_append(self): for argv in self.add_help_argv_list: args = patch_help_option(argv) target = copy.copy(argv[1:]) target.append('-h') self.assertEqual(target, args, "Help option not patch correctly: %s" % argv)
def test_help_append_with_debug_option(self): argvlist = copy.copy(self.add_help_argv_list) for argv in argvlist: argv.insert(1, "--debug") args = patch_help_option(argv) target = copy.copy(argv[1:]) target.append('-h') self.assertEqual(target, args, "Help option not patch correctly: %s" % argv)
def test_help_not_append_with_debug_option(self): argvlist = copy.copy(self.not_add_help_argv_list) for argv in argvlist: argv.insert(1, "--debug") args = patch_help_option(argv) self.assertEqual( argv[1:], args, "Should not patch help option correctly: %s" % argv)
def compare_output(self, output, args): parser = initialize_parser() argv = patch_help_option(args) parser.parse_args(argv) out = self.buf.getvalue() self.buf.truncate(0) self.assertEqual(' '.join(output.split()), ' '.join(out.split()))
def test_help_not_append_with_debug_option(self): argvlist = copy.copy(self.not_add_help_argv_list) for argv in argvlist: argv.insert(1, "--debug") args = patch_help_option(argv) self.assertEqual(argv[1:], args, "Should not patch help option correctly: %s" % argv)
def test_help_not_append(self): for argv in self.not_add_help_argv_list: args = patch_help_option(argv) self.assertEqual(argv[1:], args, "Should not patch help option correctly: %s" % argv)
def test_help_not_append(self): for argv in self.not_add_help_argv_list: args = patch_help_option(argv) self.assertEqual( argv[1:], args, "Should not patch help option correctly: %s" % argv)