Skip to content
This repository was archived by the owner on Dec 10, 2018. It is now read-only.

Commit

Permalink
Fix the test of huge result by non-Cython TBufferedTransportFactory.
Browse files Browse the repository at this point in the history
  • Loading branch information
keitheis committed Jun 30, 2016
1 parent 739a447 commit 2d9bc02
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def test_string_api(server):

def test_huge_res(server):
with client() as c:
big_str = "world" * 100
big_str = "world" * 100000
assert c.hello(big_str) == "hello " + big_str


Expand Down
15 changes: 11 additions & 4 deletions thriftpy/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,21 @@
from thriftpy.server import TServer
from thriftpy.transport import (
TTransportBase,
TBufferedTransportFactory,
TMemoryBuffer
)
# Avoid TypeError: Cannot convert TBufferedTransport
# to thriftpy.transport.cybase.CyTransportBase.
# Explicitly use Python version instead of Cython version for libraries below
# to address some mystery issues for now.
#
# Avoid TypeError: Cannot convert TBufferedTransport to
# thriftpy.transport.cybase.CyTransportBase.
from thriftpy.protocol.binary import TBinaryProtocolFactory
# Avoid raised error of too small buffer allocated by TCyBufferedTransport.
from thriftpy.transport.buffered import TBufferedTransport
# Also, using TCyBufferedTransportFactory will let THttpClient write a broken
# string to server, which making server freezed in transport.readall() method.
from thriftpy.transport.buffered import (
TBufferedTransport,
TBufferedTransportFactory,
)


HTTP_URI = '{scheme}://{host}:{port}{path}'
Expand Down

0 comments on commit 2d9bc02

Please sign in to comment.