From 8b58bf4db3a15d186050d8025ef3754054d1999b Mon Sep 17 00:00:00 2001 From: mirai Date: Fri, 2 Jan 2026 23:35:20 +0300 Subject: [PATCH] Final notes [2] --- tests/conftest.py | 6 +++--- tests/test_health.py | 5 +---- tests/test_srp.py | 2 +- tests/test_websocket.py | 4 +--- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 9e8ae82..8db46e0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -19,7 +19,7 @@ from cmd_chat.server.routes import register_routes @pytest.fixture def app(): name = f"test-{uuid.uuid4().hex[:8]}" - + app = Sanic(name) Extend(app) @@ -32,10 +32,10 @@ def app(): register_routes(app) TestManager(app) - + return app @pytest.fixture def test_client(app): - return app.test_client \ No newline at end of file + return app.test_client diff --git a/tests/test_health.py b/tests/test_health.py index 5dbb16f..7b97d6b 100644 --- a/tests/test_health.py +++ b/tests/test_health.py @@ -1,6 +1,3 @@ - - - class TestHealth: def test_health_ok(self, test_client): @@ -11,4 +8,4 @@ class TestHealth: assert data["status"] == "ok" assert "messages" in data assert "users" in data - assert "timestamp" in data \ No newline at end of file + assert "timestamp" in data diff --git a/tests/test_srp.py b/tests/test_srp.py index 1f06c96..d1bf464 100644 --- a/tests/test_srp.py +++ b/tests/test_srp.py @@ -38,4 +38,4 @@ class TestSRPFlow: "M": base64.b64encode(b"fake").decode(), }, ) - assert response.status == 401 \ No newline at end of file + assert response.status == 401 diff --git a/tests/test_websocket.py b/tests/test_websocket.py index b9f8718..66bc5ec 100644 --- a/tests/test_websocket.py +++ b/tests/test_websocket.py @@ -1,5 +1,3 @@ - - class TestWebSocket: def test_ws_connect_no_user_id(self, test_client): @@ -9,4 +7,4 @@ class TestWebSocket: def test_ws_connect_invalid_session(self, test_client): _, ws = test_client.websocket("/ws/chat?user_id=invalid123") - assert ws is not None \ No newline at end of file + assert ws is not None