diff options
author | Neil Williams <neil@reddit.com> | 2018-08-13 16:12:24 -0700 |
---|---|---|
committer | Aki Sukegawa <nsukeg@gmail.com> | 2018-09-01 10:24:43 +0900 |
commit | 66a44c5d8d57bd0c2e2afd228a29b5bc679a6770 (patch) | |
tree | b8e114bb322b05217224926c866b21a01a7af27c /test/py/TestClient.py | |
parent | 8de3749235db03c1d043c9f31dcbdc4c0fb011ea (diff) | |
download | thrift-66a44c5d8d57bd0c2e2afd228a29b5bc679a6770.tar.gz |
THRIFT-4621 Add THeader for Python
Client: py
Diffstat (limited to 'test/py/TestClient.py')
-rwxr-xr-x | test/py/TestClient.py | 11 |
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 |