summaryrefslogtreecommitdiff
path: root/test/py/TestClient.py
diff options
context:
space:
mode:
authorNeil Williams <neil@reddit.com>2018-08-13 16:12:24 -0700
committerAki Sukegawa <nsukeg@gmail.com>2018-09-01 10:24:43 +0900
commit66a44c5d8d57bd0c2e2afd228a29b5bc679a6770 (patch)
treeb8e114bb322b05217224926c866b21a01a7af27c /test/py/TestClient.py
parent8de3749235db03c1d043c9f31dcbdc4c0fb011ea (diff)
downloadthrift-66a44c5d8d57bd0c2e2afd228a29b5bc679a6770.tar.gz
THRIFT-4621 Add THeader for Python
Client: py
Diffstat (limited to 'test/py/TestClient.py')
-rwxr-xr-xtest/py/TestClient.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/py/TestClient.py b/test/py/TestClient.py
index 216416228..ddcce8db0 100755
--- a/test/py/TestClient.py
+++ b/test/py/TestClient.py
@@ -348,6 +348,12 @@ class MultiplexedJSONTest(MultiplexedOptionalTest):
return TMultiplexedProtocol.TMultiplexedProtocol(wrapped_proto, "SecondService")
+class HeaderTest(MultiplexedOptionalTest):
+ def get_protocol(self, transport):
+ factory = THeaderProtocol.THeaderProtocolFactory()
+ return factory.getProtocol(transport)
+
+
def suite():
suite = unittest.TestSuite()
loader = unittest.TestLoader()
@@ -359,6 +365,8 @@ def suite():
suite.addTest(loader.loadTestsFromTestCase(AcceleratedCompactTest))
elif options.proto == 'compact':
suite.addTest(loader.loadTestsFromTestCase(CompactTest))
+ elif options.proto == 'header':
+ suite.addTest(loader.loadTestsFromTestCase(HeaderTest))
elif options.proto == 'json':
suite.addTest(loader.loadTestsFromTestCase(JSONTest))
elif options.proto == 'multi':
@@ -408,7 +416,7 @@ if __name__ == "__main__":
dest="verbose", const=0,
help="minimal output")
parser.add_option('--protocol', dest="proto", type="string",
- help="protocol to use, one of: accel, accelc, binary, compact, json, multi, multia, multiac, multic, multij")
+ help="protocol to use, one of: accel, accelc, binary, compact, header, json, multi, multia, multiac, multic, multij")
parser.add_option('--transport', dest="trans", type="string",
help="transport to use, one of: buffered, framed, http")
parser.set_defaults(framed=False, http_path=None, verbose=1, host='localhost', port=9090, proto='binary')
@@ -431,6 +439,7 @@ if __name__ == "__main__":
from thrift.transport import TZlibTransport
from thrift.protocol import TBinaryProtocol
from thrift.protocol import TCompactProtocol
+ from thrift.protocol import THeaderProtocol
from thrift.protocol import TJSONProtocol
from thrift.protocol import TMultiplexedProtocol