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 - ")
示例#2
0
 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")
示例#4
0
 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""")
示例#7
0
 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""")
示例#8
0
 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)