def test_check1(self): """Test check1 """ sys.argv = [sys.argv[0]] try: out = StringIO() sys.stdout = out check_mpt_status.main() except SystemExit, e: self.assertEquals(type(e), type(SystemExit())) self.assertEquals(e.code, 0) output = out.getvalue().strip() assert output.startswith("OK - ")
def test_badarguments(self): """Test Badarguments """ sys.argv = [sys.argv[0]] sys.argv.append("-g") try: out = StringIO() sys.stdout = out check_mpt_status.main() except SystemExit, e: self.assertEquals(type(e), type(SystemExit())) self.assertEquals(e.code, 3) output = out.getvalue().strip() assert output.startswith("option -g not recognized")
def test_badarguments(self): """Test Badarguments """ sys.argv = [sys.argv[0]] sys.argv.append('-g') try: out = StringIO() sys.stdout = out check_mpt_status.main() except SystemExit, e: self.assertEquals(type(e), type(SystemExit())) self.assertEquals(e.code, 3) output = out.getvalue().strip() assert output.startswith("option -g not recognized")
def test_version(self): """Test version output : -V """ sys.argv = [sys.argv[0]] sys.argv.append("-V") try: out = StringIO() sys.stdout = out check_mpt_status.main() except SystemExit, e: self.assertEquals(type(e), type(SystemExit())) self.assertEquals(e.code, 3) output = out.getvalue().strip() assert output.startswith("check_mpt_status.py v%s" % check_mpt_status.PLUGIN_VERSION)
def test_help(self): """Test help output : -h """ sys.argv = [sys.argv[0]] sys.argv.append("-h") try: out = StringIO() sys.stdout = out check_mpt_status.main() except SystemExit, e: self.assertEquals(type(e), type(SystemExit())) self.assertEquals(e.code, 3) output = out.getvalue().strip() assert output.startswith("""check_mpt_status""")
def test_help(self): """Test help output : -h """ sys.argv = [sys.argv[0]] sys.argv.append('-h') try: out = StringIO() sys.stdout = out check_mpt_status.main() except SystemExit, e: self.assertEquals(type(e), type(SystemExit())) self.assertEquals(e.code, 3) output = out.getvalue().strip() assert output.startswith("""check_mpt_status""")
def test_version(self): """Test version output : -V """ sys.argv = [sys.argv[0]] sys.argv.append('-V') try: out = StringIO() sys.stdout = out check_mpt_status.main() except SystemExit, e: self.assertEquals(type(e), type(SystemExit())) self.assertEquals(e.code, 3) output = out.getvalue().strip() assert output.startswith("check_mpt_status.py v%s" % check_mpt_status.PLUGIN_VERSION)