From f673b8a9104d92d77559e61658a8fa0951923806 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Tue, 15 Dec 2020 15:01:53 -0800 Subject: [PATCH] expand the emulated Process mock.. --- bitelab/mocks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bitelab/mocks.py b/bitelab/mocks.py index f54d3b6..2d897b9 100644 --- a/bitelab/mocks.py +++ b/bitelab/mocks.py @@ -36,6 +36,10 @@ def wrap_subprocess_exec(mockobj, stdout=b'', stderr=b'', retcode=0): proc = Mock() proc.communicate = AsyncMock() proc.communicate.return_value = (stdout, stderr) + proc.stdout.read = AsyncMock() + proc.stdout.read.side_effect = [ stdout, b'' ] + proc.stdin.drain = AsyncMock() + proc.stdin.wait_closed = AsyncMock() proc.wait = AsyncMock() proc.wait.return_value = retcode proc.returncode = retcode