コード例 #1
0
ファイル: test.py プロジェクト: 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)
コード例 #2
0
ファイル: test.py プロジェクト: rstgroup/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)
コード例 #3
0
ファイル: test.py プロジェクト: rstgroup/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)
コード例 #4
0
ファイル: test.py プロジェクト: rstgroup/nagctl
	def test_parseArgument_command(self):
		"""parseArguments: set commands"""

		sys.argv = ["test.py", "-?", "command", "and", "conquer"]
		self.assertEqual(nagctl.parseArguments()[1][:], ["command", "and", "conquer"])
コード例 #5
0
ファイル: test.py プロジェクト: rstgroup/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")
コード例 #6
0
ファイル: test.py プロジェクト: 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)
コード例 #7
0
ファイル: test.py プロジェクト: 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"])
コード例 #8
0
ファイル: test.py プロジェクト: 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")