Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def command_callable(command, stdin):
if 'cloc' in command:
return PopenBehaviour(stdout=cloc_out)
elif 'xcodebuild -version' in command:
return PopenBehaviour(stdout=b'Xcode 10.0\nBuild version 10A255\n')
return PopenBehaviour(stdout=b'test_out', stderr=b'test_error')
def _resolve_behaviour(self, stdout, stderr, returncode,
pid, poll_count, behaviour):
if behaviour is None:
return PopenBehaviour(
stdout, stderr, returncode, pid, poll_count
)
else:
return behaviour
def command_callable(command, stdin):
if 'cloc' in command:
return PopenBehaviour(stdout=cloc_out)
elif 'xcodebuild -version' in command:
return PopenBehaviour(stdout=b'Xcode 10.0\nBuild version 10A255\n')
return PopenBehaviour(stdout=b'test_out', stderr=b'test_error')