From 58a833e98761bc39c23cffa26916615fbdc21bda Mon Sep 17 00:00:00 2001 From: Raphael Deem Date: Tue, 7 Mar 2017 16:39:26 -0800 Subject: [PATCH] rename TestClient --- sanic/app.py | 4 ++-- sanic/testing.py | 2 +- sanic/utils.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sanic/app.py b/sanic/app.py index bb7b0efe..cb57fcf3 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -17,7 +17,7 @@ from sanic.response import HTTPResponse, StreamingHTTPResponse from sanic.router import Router from sanic.server import serve, serve_multiple, HttpProtocol from sanic.static import register as static_register -from sanic.testing import TestClient +from sanic.testing import SanicTestClient from sanic.views import CompositionView from sanic.websocket import WebSocketProtocol, ConnectionClosed @@ -482,7 +482,7 @@ class Sanic: @property def test_client(self): - return TestClient(self) + return SanicTestClient(self) # -------------------------------------------------------------------- # # Execution diff --git a/sanic/testing.py b/sanic/testing.py index 387424b0..77f4ff85 100644 --- a/sanic/testing.py +++ b/sanic/testing.py @@ -4,7 +4,7 @@ HOST = '127.0.0.1' PORT = 42101 -class TestClient: +class SanicTestClient: def __init__(self, app): self.app = app diff --git a/sanic/utils.py b/sanic/utils.py index 6b97327b..176ce266 100644 --- a/sanic/utils.py +++ b/sanic/utils.py @@ -1,6 +1,6 @@ import warnings -from sanic.testing import TestClient +from sanic.testing import SanicTestClient def sanic_endpoint_test(app, method='get', uri='/', gather_request=True, @@ -11,7 +11,7 @@ def sanic_endpoint_test(app, method='get', uri='/', gather_request=True, "the next major version after 0.4.0. Please use the `test_client` " "available on the app object.", DeprecationWarning) - test_client = TestClient(app) + test_client = SanicTestClient(app) return test_client._sanic_endpoint_test( method, uri, gather_request, debug, server_kwargs, *request_args, **request_kwargs)