[Twisted-Python] Doubt regarding registerAdapter in sshsimpleserver.py

2011-06-23 Thread Anshul Singhle
Hi, I'm a Twisted newbie and I'm working on a custom ssh daemon for serving git. I happened to read one of the example files sshsimpleserver.py at * http://twistedmatrix.com/projects/conch/documentation/examples/* . At line 93 ExampleSession is registered as an Adapter for ExampleAvatar adapting it

Re: [Twisted-Python] Doubt regarding registerAdapter in sshsimpleserver.py

2011-06-24 Thread Anshul Singhle
Thanks. That clears it. ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

[Twisted-Python] Conch Testing server and client

2011-07-01 Thread Anshul Singhle
Hi, 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'm not able to do it from within the test case. What I'm trying is : class TestAccou

Re: [Twisted-Python] Conch Testing server and client

2011-07-01 Thread Anshul Singhle
I understand that. The problem I'm facing is that unless I write "reactor.run()" my client isn't starting up. From what I understood in the trial documentation, I should simply call the connectTCP method and then return a deferred. However, if I do that, the client isn't starting. I'll post some of

Re: [Twisted-Python] Conch Testing server and client

2011-07-01 Thread Anshul Singhle
> Is that the Python standard library's unittest.TestCase, or > twisted.trial.unittest.TestCase? As Jean-Paul says, Twisted's TestCase > should automatically handle the reactor for you; that's why it exists. > :) > It is Twisted's TestCase( twisted.trial.unittest.TestCase) _

Re: [Twisted-Python] Conch Testing server and client

2011-07-01 Thread Anshul Singhle
Ok, here goes : The test code : from twisted.trial import unittest from twisted.internet import defer, protocol, reactor class TestAccountStatus(unittest.TestCase): def setUp(self): ssh_server = Server() self.server = reactor.listenTCP(ssh_server.port,

Re: [Twisted-Python] Conch Testing server and client

2011-07-01 Thread Anshul Singhle
> ClientCreator.connectTCP returns a Deferred that fires with a Protocol > instance (in this case, a SimpleTransport instance), which you are then > comparing with a string in got_data(). This fails, as one would expect. > > So then how do i get the protocol to run? and how do i get the data receiv