Esempio n. 1
0
File: test.py Progetto: sasg/nagctl
    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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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"])
Esempio n. 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")
Esempio n. 6
0
File: test.py Progetto: sasg/nagctl
    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)
Esempio n. 7
0
File: test.py Progetto: sasg/nagctl
    def test_parseArgument_command(self):
        """parseArguments: set commands"""

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