Hi,<br>I have to write tests for a custom conch server. My approach is to make a test client and then connect it to my server in my testcase. I have been able to create a client that can interface with my server, but i&#39;m not able to do it from within the test case.<br>
What I&#39;m trying is :<br>class TestAccountStatus(unittest.TestCase):<br>     def setUp(self):<br>         ssh_server = Server()<br>         self.server = reactor.listenTCP(ssh_server.port, <br>                      ssh_server.application(), <br>
                      interface=ssh_server.interface)<br>     def tearDown(self):<br>         server, self.server = self.server,None<br>         return server.stopListening()<br>     def test_1(self):<br>         d = protocol.ClientCreator(reactor, SimpleTransport).connectTCP(&#39;localhost&#39;, self.server.getHost().port)<br>
         return d<br>The transport SimpleTransport is my custom transport.SSHClientTransport instance. The class Server() is a wrapper around an SSHFactory insatance.<br>The problem I&#39;m facing is that after this line &gt;<br>
d = protocol.ClientCreator(reactor, SimpleTransport).connectTCP(&#39;localhost&#39;, self.server.getHost().port)<br>I have to write reactor.run(), otherwise the client is not starting. If I write reactor.run() the test doesn&#39;t stop (understandable since the reactor isn&#39;t being stopped).<br>
Basically I want to know how I can start the client without running reactor.run()<br><br>Thanks in Advance!!<br>Anshul<br>