def __init__(self, server=None): # # If a server isn't specified, # spawn a new one. # if server is None: server = ZombieProxyServer() self.client = ZombieProxyClient(server.socket)
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')
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()
def setUp(self): super(TestServerCommunication, self).setUp() self.server = ZombieProxyServer() self.client = ZombieProxyClient()
def setUp(self): super(TestServerSpawn, self).setUp() self.server = ZombieProxyServer()