From: Yeray Diaz Diaz Date: Wed, 4 Sep 2019 11:43:24 +0000 (+0100) Subject: Add test for origin from URL string (#312) X-Git-Tag: 0.7.3~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa74aaa6dbd9578b094d2dffb2c9f409e2bd8f34;p=thirdparty%2Fhttpx.git Add test for origin from URL string (#312) --- diff --git a/tests/models/test_url.py b/tests/models/test_url.py index 80542db9..0a8efe12 100644 --- a/tests/models/test_url.py +++ b/tests/models/test_url.py @@ -1,6 +1,6 @@ import pytest -from httpx import URL +from httpx import URL, Origin from httpx.exceptions import InvalidURL @@ -175,3 +175,11 @@ def test_url_set(): url_set = set(urls) assert all(url in urls for url in url_set) + + +def test_origin_from_url_string(): + origin = Origin("https://example.com") + assert origin.scheme == "https" + assert origin.is_ssl + assert origin.host == "example.com" + assert origin.port == 443