Merge "Fix emerge testcases"

This commit is contained in:
Zuul 2019-09-09 20:12:39 +00:00 committed by Gerrit Code Review
commit a3924539e2
2 changed files with 6 additions and 2 deletions

View File

@ -530,6 +530,10 @@ class Emerge(Platform):
['equery', 'l', '--format=\'$version\'', pkg_name],
stderr=subprocess.STDOUT).decode(getpreferredencoding(False))
except subprocess.CalledProcessError as e:
# The output is currently not used in the test cases.
# Nevertheless the next statement checks if the given
# parameter has the correct type.
e.output.decode(getpreferredencoding(False))
if e.returncode == 3:
return None
raise

View File

@ -665,7 +665,7 @@ class TestEmerge(TestCase):
platform = Emerge()
def _side_effect_raise(*args, **kwargs):
raise subprocess.CalledProcessError(3, [], '')
raise subprocess.CalledProcessError(3, [], b'')
mocked_checkoutput = self.useFixture(
fixtures.MockPatchObject(subprocess, 'check_output')).mock
@ -680,7 +680,7 @@ class TestEmerge(TestCase):
platform = Emerge()
def _side_effect_raise(*args, **kwargs):
raise subprocess.CalledProcessError(3, [], '')
raise subprocess.CalledProcessError(3, [], b'')
mocked_checkoutput = self.useFixture(
fixtures.MockPatchObject(subprocess, 'check_output')).mock