def test_parseArgument_increment(self): """parseArguments: increment a numeric option""" sys.argv = ["test.py", "-?", "-v", "-?"] self.assertEqual(nagctl.parseArguments()[0]["help"], 2) nagctl.conf["verbose"] = 1 self.assertEqual(nagctl.parseArguments()[0]["verbose"], 2)
def test_parseArgument_dry_run_verbose(self): """parseArguments: dry-run mode should increase verbosity""" sys.argv = ["test.py", "-D"] self.assertEqual(nagctl.parseArguments()[0]["verbose"], 2)
def test_parseArgument_command(self): """parseArguments: set commands""" sys.argv = ["test.py", "-?", "command", "and", "conquer"] self.assertEqual(nagctl.parseArguments()[1][:], ["command", "and", "conquer"])
def test_parseArgument_option(self): """parseArguments: set a string option""" nagctl.conf["config"] = "default.cfg" sys.argv = ["test.py", "-c", "test.cfg"] self.assertEqual(nagctl.parseArguments()[0]["config"], "test.cfg")