Skip to content

Commit

Permalink
Merge pull request #63 from msabramo/test_use_UnixAdapter_directly
Browse files Browse the repository at this point in the history
test: add test_use_UnixAdapter_directly
  • Loading branch information
msabramo authored Jan 3, 2022
2 parents 8449bc0 + 34fffb0 commit 31bdd06
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions requests_unixsocket/tests/test_requests_unixsocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@
logger = logging.getLogger(__name__)


def test_use_UnixAdapter_directly():
"""Test using UnixAdapter directly, because
https://github.com/httpie/httpie-unixsocket does this
"""
adapter = requests_unixsocket.UnixAdapter()
prepared_request = requests.Request(
method='GET',
url='http+unix://%2Fvar%2Frun%2Fdocker.sock/info',
).prepare()
url = adapter.request_url(request=prepared_request, proxies=None)
assert url == '/info'


def test_unix_domain_adapter_ok():
with UnixSocketServerThread() as usock_thread:
session = requests_unixsocket.Session('http+unix://')
Expand Down

0 comments on commit 31bdd06

Please sign in to comment.