Modify patched stdout in test_malformed_output

This commit is contained in:
ybnd 2020-02-05 09:03:45 +01:00
parent 7005691410
commit 63ea17365a
2 changed files with 4 additions and 7 deletions

View file

@ -156,18 +156,13 @@ class Bs1770gainBackend(Backend):
version_out = call([cmd, '--version'])
self.command = cmd
self.version = re.search(
'([0-9]+.[0-9]+.[0-9]+), ',
'bs1770gain ([0-9]+.[0-9]+.[0-9]+), ',
version_out.stdout.decode('utf-8')
).group(1)
except OSError:
raise FatalReplayGainError(
u'Is bs1770gain installed?'
)
except AttributeError:
# Raised by ReplayGainLdnsCliMalformedTest.test_malformed_output
# in test_replaygain.py; bs1770gain backend runs even though
# the bs1770gain command is not found test.helper.has_program
self.version = '0.0.0'
if not self.command:
raise FatalReplayGainError(
u'no replaygain command found: install bs1770gain'

View file

@ -230,7 +230,9 @@ class ReplayGainLdnsCliMalformedTest(TestHelper, unittest.TestCase):
# Patch call to return nothing, bypassing the bs1770gain installation
# check.
call_patch.return_value = CommandOutput(stdout=b"", stderr=b"")
call_patch.return_value = CommandOutput(
stdout=b'bs1770gain 0.0.0, ', stderr=b''
)
try:
self.load_plugins('replaygain')
except Exception: