Longer timeout and fiddling around the edges (debug, callback args)
This commit is contained in:
@ -17,29 +17,34 @@ from datetime import datetime as dt
|
|||||||
|
|
||||||
class Able(unittest.TestCase):
|
class Able(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
#print "Connecting ...",
|
debug = False
|
||||||
|
if debug:
|
||||||
|
print "Connecting ...",
|
||||||
self.factory = SICSClientFactory()
|
self.factory = SICSClientFactory()
|
||||||
self.sics = None
|
self.sics = None
|
||||||
self.deferred = defer.Deferred()
|
self.deferred = defer.Deferred()
|
||||||
def cb_login(client, *args, **kw):
|
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():
|
if 'test_suite' not in globals():
|
||||||
d = self.load_test_suite()
|
d = self.load_test_suite()
|
||||||
d.addCallback(cb_login)
|
d.addCallback(cb_login, "Test_Suite")
|
||||||
elif 'sicsconfig' not in globals():
|
elif 'sicsconfig' not in globals():
|
||||||
d = self.load_sicsconfig()
|
d = self.load_sicsconfig()
|
||||||
d.addCallback(cb_login)
|
d.addCallback(cb_login, "SICS_Config")
|
||||||
elif 'hipadaba' not in globals():
|
elif 'hipadaba' not in globals():
|
||||||
d = self.load_hipadaba()
|
d = self.load_hipadaba()
|
||||||
d.addCallback(cb_login)
|
d.addCallback(cb_login, "HiPaDaBa")
|
||||||
else:
|
else:
|
||||||
self.deferred.callback(True)
|
self.deferred.callback(True)
|
||||||
def cb_connect(client, *args, **kw):
|
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 = client
|
||||||
self.sics.factory = self.factory
|
self.sics.factory = self.factory
|
||||||
self.sics.login_deferred.addCallback(cb_login)
|
self.sics.login_deferred.addCallback(cb_login, "Login", Fred="Fred")
|
||||||
#print "Connected"
|
if debug:
|
||||||
|
print "Connected"
|
||||||
creator = protocol.ClientCreator(reactor, SicsProtocol)
|
creator = protocol.ClientCreator(reactor, SicsProtocol)
|
||||||
d = creator.connectTCP("localhost", 60003)
|
d = creator.connectTCP("localhost", 60003)
|
||||||
d = d.addCallback(cb_connect)
|
d = d.addCallback(cb_connect)
|
||||||
@ -122,6 +127,7 @@ class Baker(Able):
|
|||||||
d = self.sics.login_deferred
|
d = self.sics.login_deferred
|
||||||
d.addCallback(cb0)
|
d.addCallback(cb0)
|
||||||
return d
|
return d
|
||||||
|
test_000_000_login.timeout = 10
|
||||||
|
|
||||||
def test_000_001_fileeval(self):
|
def test_000_001_fileeval(self):
|
||||||
self.assertTrue('test_suite' in globals())
|
self.assertTrue('test_suite' in globals())
|
||||||
|
Reference in New Issue
Block a user