def test_env(self): test_dict = {"HOME": "/tmp/", "var1": "VALUE", "Test2": "0"} output = launch_process('echo "${HOME};${var1};${Test2}"', env=test_dict) self.assertDictEqual(output["env"], test_dict) self.assertEqual(output["stdout"], b"/tmp/;VALUE;0\n")
def test_failed(self): output = launch_process('echo "Error" 1>&2; exit 1') self.assertEqual(output["stdout"], b"") self.assertEqual(output["stderr"], b"Error\n") self.assertEqual(output["return_code"], 1)
def test_success(self): output = launch_process('echo "Hello world"') self.assertEqual(output["stdout"], b"Hello world\n") self.assertEqual(output["stderr"], b"") self.assertEqual(output["return_code"], 0)
def test_env(self): test_dict = {'HOME': '/tmp/', 'var1': 'VALUE', 'Test2': '0'} output = launch_process('echo "${HOME};${var1};${Test2}"', env=test_dict) self.assertDictEqual(output['env'], test_dict) self.assertEqual(output['stdout'], b'/tmp/;VALUE;0\n')
def test_failed(self): output = launch_process('echo "Error" 1>&2; exit 1') self.assertEqual(output['stdout'], b'') self.assertEqual(output['stderr'], b'Error\n') self.assertEqual(output['return_code'], 1)
def test_success(self): output = launch_process('echo "Hello world"') self.assertEqual(output['stdout'], b'Hello world\n') self.assertEqual(output['stderr'], b'') self.assertEqual(output['return_code'], 0)