Longer timeout and fiddling around the edges (debug, callback args)

This commit is contained in:
Douglas Clowes
2014-05-26 12:55:22 +10:00
parent 70e1cdcd01
commit f62fb5a91c

View File

@ -17,29 +17,34 @@ from datetime import datetime as dt
class Able(unittest.TestCase):
def setUp(self):
#print "Connecting ...",
debug = False
if debug:
print "Connecting ...",
self.factory = SICSClientFactory()
self.sics = None
self.deferred = defer.Deferred()
def cb_login(client, *args, **kw):
#print "cb_login:", client, args, kw
if debug:
print "cb_login:", client, args, kw
if 'test_suite' not in globals():
d = self.load_test_suite()
d.addCallback(cb_login)
d.addCallback(cb_login, "Test_Suite")
elif 'sicsconfig' not in globals():
d = self.load_sicsconfig()
d.addCallback(cb_login)
d.addCallback(cb_login, "SICS_Config")
elif 'hipadaba' not in globals():
d = self.load_hipadaba()
d.addCallback(cb_login)
d.addCallback(cb_login, "HiPaDaBa")
else:
self.deferred.callback(True)
def cb_connect(client, *args, **kw):
#print "cb_connect:", client, client.login, args, kw
if debug:
print "cb_connect:", client, client.login, args, kw
self.sics = client
self.sics.factory = self.factory
self.sics.login_deferred.addCallback(cb_login)
#print "Connected"
self.sics.login_deferred.addCallback(cb_login, "Login", Fred="Fred")
if debug:
print "Connected"
creator = protocol.ClientCreator(reactor, SicsProtocol)
d = creator.connectTCP("localhost", 60003)
d = d.addCallback(cb_connect)
@ -122,6 +127,7 @@ class Baker(Able):
d = self.sics.login_deferred
d.addCallback(cb0)
return d
test_000_000_login.timeout = 10
def test_000_001_fileeval(self):
self.assertTrue('test_suite' in globals())