Ejemplo n.º 1
0
 def test_muterun_good_command_stdout(self):
     out = muterun(self.good_command)
     self.assertEqual(b"test command\n", out.stdout) # stdout string is correct
Ejemplo n.º 2
0
 def test_muterun_bad_command_return_type(self):
     self.assertEqual(type(NakedObject()), type(muterun(self.bad_command))) # returns NakedObject on error
Ejemplo n.º 3
0
 def test_muterun_good_command_exitcode(self):
     out = muterun(self.good_command)
     self.assertEqual(0, out.exitcode) # exit code = 0 = success
Ejemplo n.º 4
0
 def test_muterun_bad_command_stderr(self):
     out = muterun(self.bad_command)
     self.assertTrue(b'bogusapp: command not found'
                     in out.stderr)  # has std err message on failure
Ejemplo n.º 5
0
 def test_muterun_good_command_return_type(self):
     self.assertEqual(type(NakedObject()), type(muterun(self.good_command))) # returns NakedObject on success
Ejemplo n.º 6
0
 def test_muterun_bad_command_stdout(self):
     out = muterun(self.bad_command)
     self.assertEqual(b"", out.stdout) # std out is empty string on failure
Ejemplo n.º 7
0
 def test_muterun_missing_option_exitcode(self):
     out = muterun(self.missing_option)
     self.assertEqual(1, out.exitcode) # returns 1 on missing option to ls
Ejemplo n.º 8
0
 def test_muterun_good_command_exitcode(self):
     out = muterun(self.good_command)
     self.assertEqual(0, out.exitcode)  # exit code = 0 = success
Ejemplo n.º 9
0
 def test_muterun_good_command_stdout(self):
     out = muterun(self.good_command)
     self.assertEqual(b"test command\n",
                      out.stdout)  # stdout string is correct
Ejemplo n.º 10
0
 def test_muterun_good_command_return_type(self):
     self.assertEqual(type(
         NakedObject()), type(muterun(
             self.good_command)))  # returns NakedObject on success
Ejemplo n.º 11
0
 def test_muterun_bad_command_return_type(self):
     self.assertEqual(type(
         NakedObject()), type(muterun(
             self.bad_command)))  # returns NakedObject on error
Ejemplo n.º 12
0
 def test_muterun_missing_option_stdout(self):
     out = muterun(self.missing_option)
     self.assertEqual(b"",
                      out.stdout)  # std out is empty string on failure
Ejemplo n.º 13
0
 def test_muterun_missing_option_stderr(self):
     out = muterun(self.missing_option)
     self.assertTrue(
         len(out.stderr) > 0)  # there is a stderr message present
Ejemplo n.º 14
0
 def test_muterun_missing_option_exitcode(self):
     out = muterun(self.missing_option)
     self.assertEqual(1,
                      out.exitcode)  # returns 1 on missing option to ls
Ejemplo n.º 15
0
 def test_muterun_good_command_stderr(self):
     out = muterun(self.good_command)
     self.assertEqual(b"", out.stderr)  # stderr empty string when successful command
Ejemplo n.º 16
0
 def test_muterun_good_command_stderr(self):
     out = muterun(self.good_command)
     self.assertEqual(
         b"", out.stderr)  # stderr empty string when successful command
Ejemplo n.º 17
0
 def test_muterun_bad_command_exitcode(self):
     out = muterun(self.bad_command)
     self.assertEqual(127, out.exitcode) # returns 127 on absent executable
Ejemplo n.º 18
0
 def test_muterun_bad_command_exitcode(self):
     out = muterun(self.bad_command)
     self.assertEqual(127,
                      out.exitcode)  # returns 127 on absent executable
Ejemplo n.º 19
0
 def test_muterun_bad_command_stderr(self):
     out = muterun(self.bad_command)
     self.assertTrue(b'bogusapp: command not found' in out.stderr) # has std err message on failure
Ejemplo n.º 20
0
 def test_muterun_missing_option_stdout(self):
     out = muterun(self.missing_option)
     self.assertEqual(b"", out.stdout)  # std out is empty string on failure
Ejemplo n.º 21
0
 def test_muterun_missing_option_stderr(self):
     out = muterun(self.missing_option)
     self.assertTrue(len(out.stderr) > 0) # there is a stderr message present
Ejemplo n.º 22
0
 def test_muterun_bad_command_stdout(self):
     out = muterun(self.bad_command)
     self.assertEqual(b"",
                      out.stdout)  # std out is empty string on failure