Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix HTTP_URI typo in http.py #148

Merged
merged 1 commit into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tests/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ def client_with_url(timeout=3000):
url="http://127.0.0.1:6080", timeout=timeout)


def client_without_url(timeout=3000):
return make_client(addressbook.AddressBookService, host="127.0.0.1",
port=6080, path="foo", timeout=timeout)


def test_client_context(server):
with client() as c1, client_context_with_url() as c2:
assert c1.hello("world") == c2.hello("world")
Expand All @@ -128,6 +133,11 @@ def test_clients(server):
c2.close()


def test_clients_without_url(server):
c = client_without_url()
assert c.hello("world") == "hello world"


def test_void_api(server):
with client() as c:
assert c.ping() is None
Expand Down
2 changes: 1 addition & 1 deletion thriftpy2/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
from thriftpy2.transport import TBufferedTransportFactory


HTTP_URI = '{scheme}://{host}:{port}{path}'
HTTP_URI = '{scheme}://{host}:{port}/{path}'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change just broke things for me.

DEFAULT_HTTP_CLIENT_TIMEOUT_MS = 30000 # 30 seconds


Expand Down