summaryrefslogtreecommitdiff
path: root/test/py.twisted
diff options
context:
space:
mode:
authorNobuaki Sukegawa <nsuke@apache.org>2016-02-03 01:57:03 +0900
committerNobuaki Sukegawa <nsuke@apache.org>2016-02-04 14:28:24 +0900
commit10308cb975ac090584068d0470b81e41555b2f35 (patch)
treebc0bb670626a8a196dc00df6429ae4dcc838b4c4 /test/py.twisted
parentd094e79de7e0bd61320f006c83c0de669363bce8 (diff)
downloadthrift-10308cb975ac090584068d0470b81e41555b2f35.tar.gz
THRIFT-3596 Better conformance to PEP8
This closes #832
Diffstat (limited to 'test/py.twisted')
-rwxr-xr-xtest/py.twisted/test_suite.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/test/py.twisted/test_suite.py b/test/py.twisted/test_suite.py
index 2c07baaf8..3a59bb1f1 100755
--- a/test/py.twisted/test_suite.py
+++ b/test/py.twisted/test_suite.py
@@ -19,7 +19,10 @@
# under the License.
#
-import sys, os, glob, time
+import sys
+import os
+import glob
+import time
basepath = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(basepath, 'gen-py.twisted'))
sys.path.insert(0, glob.glob(os.path.join(basepath, '../../lib/py/build/lib.*'))[0])
@@ -35,6 +38,7 @@ from twisted.internet.protocol import ClientCreator
from zope.interface import implements
+
class TestHandler:
implements(ThriftTest.Iface)
@@ -100,6 +104,7 @@ class TestHandler:
def testTypedef(self, thing):
return thing
+
class ThriftTestCase(unittest.TestCase):
@defer.inlineCallbacks
@@ -109,15 +114,15 @@ class ThriftTestCase(unittest.TestCase):
self.pfactory = TBinaryProtocol.TBinaryProtocolFactory()
self.server = reactor.listenTCP(0,
- TTwisted.ThriftServerFactory(self.processor,
- self.pfactory), interface="127.0.0.1")
+ TTwisted.ThriftServerFactory(self.processor,
+ self.pfactory), interface="127.0.0.1")
self.portNo = self.server.getHost().port
self.txclient = yield ClientCreator(reactor,
- TTwisted.ThriftClientProtocol,
- ThriftTest.Client,
- self.pfactory).connectTCP("127.0.0.1", self.portNo)
+ TTwisted.ThriftClientProtocol,
+ ThriftTest.Client,
+ self.pfactory).connectTCP("127.0.0.1", self.portNo)
self.client = self.txclient.client
@defer.inlineCallbacks
@@ -179,7 +184,7 @@ class ThriftTestCase(unittest.TestCase):
try:
yield self.client.testException("throw_undeclared")
self.fail("should have thrown exception")
- except Exception: # type is undefined
+ except Exception: # type is undefined
pass
@defer.inlineCallbacks