Beispiel #1
0
    def test_configurable_socket(self):

        args = [
            'env', 'node',
            ZombieProxyServer.__proxy_path__(), '/tmp/zombie-custom.sock'
        ]

        with fudge.patched_context(
                subprocess, 'Popen',
            (fudge.Fake('Popen').is_callable().with_args(
                args,
                stdin=subprocess.PIPE,
                stdout=subprocess.PIPE,
                stderr=subprocess.STDOUT).returns(FakePopen()))):
            ZombieProxyServer(socket='/tmp/zombie-custom.sock')
Beispiel #2
0
    def test_stdout_redirect_exception(self):

        args = [
            'env', 'node',
            ZombieProxyServer.__proxy_path__(), '/tmp/zombie.sock'
        ]
        fake = FakePopen()
        fake.stdout = None

        with fudge.patched_context(
                subprocess, 'Popen',
            (fudge.Fake('Popen').is_callable().with_args(
                args,
                stdin=subprocess.PIPE,
                stdout=subprocess.PIPE,
                stderr=subprocess.STDOUT).returns(fake))):
            ZombieProxyServer()
Beispiel #3
0
    def test_configurable_socket(self):

        args = ['env', 'node', ZombieProxyServer.__proxy_path__(), '/tmp/zombie-custom.sock']

        with fudge.patched_context(
            subprocess,
            'Popen',
            (fudge.Fake('Popen').
                    is_callable().
                    with_args(
                        args,
                        stdin = subprocess.PIPE,
                        stdout = subprocess.PIPE,
                        stderr = subprocess.STDOUT
                    ).
                    returns(FakePopen()))
            ):
            ZombieProxyServer(socket='/tmp/zombie-custom.sock')
Beispiel #4
0
    def test_stdout_redirect_exception(self):

        args = ['env', 'node', ZombieProxyServer.__proxy_path__(), '/tmp/zombie.sock']
        fake = FakePopen()
        fake.stdout = None

        with fudge.patched_context(
            subprocess,
            'Popen',
            (fudge.Fake('Popen').
                is_callable().
                with_args(
                    args,
                    stdin = subprocess.PIPE,
                    stdout = subprocess.PIPE,
                    stderr = subprocess.STDOUT
                ).
                returns(fake))
            ):
            ZombieProxyServer()