Browse Source

expand the emulated Process mock..

main
John-Mark Gurney 4 years ago
parent
commit
f673b8a910
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      bitelab/mocks.py

+ 4
- 0
bitelab/mocks.py View File

@@ -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


Loading…
Cancel
Save