Use universal_newlines when running other commands

This will automatically convert the output to unicode/str and we will
not have to worry about decoding ourselves.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2017-09-15 09:42:33 +02:00
parent ed22e07ef9
commit ed9d7f69a6
9 changed files with 93 additions and 54 deletions

View file

@ -39,7 +39,7 @@ class TestSh(unittest.TestCase):
log = mock.Mock()
patch_iso.sh(log, ['ls'], foo='bar')
self.assertEqual(mock_run.call_args_list,
[mock.call(['ls'], foo='bar')])
[mock.call(['ls'], foo='bar', universal_newlines=True)])
self.assertEqual(log.info.call_args_list,
[mock.call('Running: %s', 'ls')])
self.assertEqual(log.debug.call_args_list,