GIT-1591 Strict Slashes behavior fix (#1594)

* fix: GIT-1591: fix strict_slashes option inheriting behavior

Signed-off-by: Harsha Narayana <harsha2k4@gmail.com>

* doc: GIT-1591: add documentation exlaining the strict_slashes behavior

Signed-off-by: Harsha Narayana <harsha2k4@gmail.com>

* fix: GIT-1591: fix deprecated for test_client

Signed-off-by: Harsha Narayana <harsha2k4@gmail.com>
This commit is contained in:
Harsha Narayana
2019-06-06 17:51:58 +05:30
committed by Stephen Sadowski
parent c15158224b
commit 13079c6e30
9 changed files with 102 additions and 25 deletions

View File

@@ -24,7 +24,9 @@ old_conn = None
class ReusableSanicConnectionPool(httpcore.ConnectionPool):
async def acquire_connection(self, origin):
global old_conn
connection = self.active_connections.pop_by_origin(origin, http2_only=True)
connection = self.active_connections.pop_by_origin(
origin, http2_only=True
)
if connection is None:
connection = self.keepalive_connections.pop_by_origin(origin)
@@ -187,11 +189,7 @@ class ReuseableSanicTestClient(SanicTestClient):
self._session = ResusableSanicSession()
try:
response = await getattr(self._session, method.lower())(
url,
verify=False,
timeout=request_keepalive,
*args,
**kwargs,
url, verify=False, timeout=request_keepalive, *args, **kwargs
)
except NameError:
raise Exception(response.status_code)