How to use the testfixtures.popen.PopenBehaviour function in testfixtures

To help you get started, we’ve selected a few testfixtures examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uber / uber-poet / tests / test_integration.py View on Github external
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')
github Simplistix / testfixtures / testfixtures / popen.py View on Github external
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
github uber / uber-poet / tests / test_integration.py View on Github external
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')