Beispiel #1
0
    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)
Beispiel #2
0
	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)
Beispiel #3
0
	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)
Beispiel #4
0
	def test_parseArgument_command(self):
		"""parseArguments: set commands"""

		sys.argv = ["test.py", "-?", "command", "and", "conquer"]
		self.assertEqual(nagctl.parseArguments()[1][:], ["command", "and", "conquer"])
Beispiel #5
0
	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")
Beispiel #6
0
    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)
Beispiel #7
0
    def test_parseArgument_command(self):
        """parseArguments: set commands"""

        sys.argv = ["test.py", "-?", "command", "and", "conquer"]
        self.assertEqual(nagctl.parseArguments()[1][:],
                         ["command", "and", "conquer"])
Beispiel #8
0
    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")