def test_run_command_subprocess_error(self, mock_subprocess): mock_subprocess.return_value = ('test', 'error') with self.assertRaises(Exception): mesos.run_command("echo test".split(" "))
def test_open_file_error(self): with self.assertRaises(Exception): mesos.run_command(mesos.open_file("test"))
def test_run_command(self): assert mesos.run_command("echo test".split(" ")) == 'test\n'