From 8ed7e52a379537256b9fc0c8baa221cd2d860973 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 23 Jul 2020 09:43:11 +0100 Subject: [PATCH] Drop fullpath setter (#1069) --- httpx/_models.py | 10 ---------- tests/models/test_url.py | 7 ------- 2 files changed, 17 deletions(-) diff --git a/httpx/_models.py b/httpx/_models.py index 892a959d65..dca3eff948 100644 --- a/httpx/_models.py +++ b/httpx/_models.py @@ -87,10 +87,6 @@ def __init__( 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 "" @@ -138,17 +134,11 @@ def query(self) -> str: @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 "" diff --git a/tests/models/test_url.py b/tests/models/test_url.py index f9a568a315..7910a8e904 100644 --- a/tests/models/test_url.py +++ b/tests/models/test_url.py @@ -177,13 +177,6 @@ def test_url_set(): 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"