git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665485
13f79535-47bb-0310-9956-
ffa450edef68
self.assertEqual(x.errorCode, 1001)
self.assertEqual(x.message, 'Xception')
+ def testAsync(self):
+ start = time.time()
+ self.client.testAsync(2)
+ end = time.time()
+ self.assertTrue(end - start < 0.2,
+ "async sleep took %f sec" % (end - start))
+
class NormalBinaryTest(AbstractTest):
protocol_factory = TBinaryProtocol.TBinaryProtocolFactory()
#!/usr/bin/env python
-import sys, glob
+import sys, glob, time
sys.path.insert(0, './gen-py')
sys.path.insert(0, glob.glob('../../lib/py/build/lib.*')[0])
x.message = str
raise x
+ def testAsync(self, seconds):
+ print 'testAsync(%d) => sleeping...' % seconds
+ time.sleep(seconds)
+ print 'done sleeping'
+
handler = TestHandler()
processor = ThriftTest.Processor(handler)
transport = TSocket.TServerSocket(9090)