Add a test with invalid unicode in spawned stdout.
stderr features identical behaviour, so is currently untested.
This commit is contained in:
parent
16a9948759
commit
28961ab177
@ -63,6 +63,20 @@ def test_start(proc, qtbot, message_mock, py_proc):
|
||||
assert qutescheme.spawn_output == proc._spawn_format(stdout="test")
|
||||
|
||||
|
||||
def test_stdout_malformed_utf8(proc, qtbot, message_mock, py_proc):
|
||||
"""Test simply starting a process."""
|
||||
with qtbot.waitSignals([proc.started, proc.finished], timeout=10000,
|
||||
order='strict'):
|
||||
argv = py_proc(r"""
|
||||
import sys
|
||||
sys.stdout.buffer.write(b"A\x80B")
|
||||
sys.exit(0)
|
||||
""")
|
||||
proc.start(*argv)
|
||||
assert not message_mock.messages
|
||||
assert qutescheme.spawn_output == proc._spawn_format(stdout="A\ufffdB")
|
||||
|
||||
|
||||
def test_start_verbose(proc, qtbot, message_mock, py_proc):
|
||||
"""Test starting a process verbosely."""
|
||||
proc.verbose = True
|
||||
|
Loading…
Reference in New Issue
Block a user