if not self.host:
raise InvalidURL("No host included in URL.")
- # Allow setting full_path to custom attributes requests
- # like OPTIONS, CONNECT, and forwarding proxy requests.
- self._full_path: typing.Optional[str] = None
-
@property
def scheme(self) -> str:
return self._uri_reference.scheme or ""
@property
def full_path(self) -> str:
- if self._full_path is not None:
- return self._full_path
path = self.path
if self.query:
path += "?" + self.query
return path
- @full_path.setter
- def full_path(self, value: typing.Optional[str]) -> None:
- self._full_path = value
-
@property
def fragment(self) -> str:
return self._uri_reference.fragment or ""
assert all(url in urls for url in url_set)
-def test_url_full_path_setter():
- url = URL("http://example.org")
-
- url.full_path = "http://example.net"
- assert url.full_path == "http://example.net"
-
-
def test_origin_from_url_string():
origin = Origin("https://example.com")
assert origin.scheme == "https"