Exemplo n.º 1
0
 def setUp(self):
     self._client_sys = FakeSys()
     self._server_sys = FakeSys()
     self._fake_clock = scalyr_util.FakeClock()
     self._client_channel = FakeClientChannel(self._fake_clock)
     self._server_channel = FakeServerChannel(self._client_channel)
     self._client = RedirectorClient(self._client_channel, sys_impl=self._client_sys, fake_clock=self._fake_clock)
     self._server = RedirectorServer(self._server_channel, sys_impl=self._server_sys)
     self._client.start()
     self._server.start()
Exemplo n.º 2
0
 def setUp(self):
     self._fake_sys = FakeSys()
     # Since the client is an actual other thread that blocks waiting for input from the server, we have to
     # simulate the time using a fake clock.  That will allow us to wait up the client thread from time to time.
     self._fake_clock = scalyr_util.FakeClock()
     # The fake channel allows us to insert bytes being sent by the server.
     self._client_channel = FakeClientChannel(self._fake_clock)
     self._client = RedirectorClient(self._client_channel, sys_impl=self._fake_sys, fake_clock=self._fake_clock)
     self._client.start()
     # Wait until the client thread begins to block for the initial accept from the server.
     self._fake_clock.block_until_n_waiting_threads(1)