fix: unit tests fixes and ruff formating
N25B-205
This commit is contained in:
@@ -6,6 +6,7 @@ from unittest.mock import MagicMock
|
||||
from control_backend.api.v1.endpoints import command
|
||||
from control_backend.schemas.ri_message import SpeechCommand
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def app():
|
||||
"""
|
||||
@@ -49,7 +50,7 @@ def test_receive_command_endpoint(client, app):
|
||||
|
||||
assert sent_data[0] == b"command"
|
||||
# Check JSON encoding roughly matches
|
||||
assert isinstance(sent_data[1], SpeechCommand)
|
||||
assert isinstance(SpeechCommand.model_validate_json(sent_data[1].decode()), SpeechCommand)
|
||||
|
||||
|
||||
def test_receive_command_invalid_payload(client):
|
||||
@@ -59,4 +60,4 @@ def test_receive_command_invalid_payload(client):
|
||||
# Missing required field(s)
|
||||
bad_payload = {"invalid": "data"}
|
||||
response = client.post("/command", json=bad_payload)
|
||||
assert response.status_code == 422 # validation error
|
||||
assert response.status_code == 422 # validation error
|
||||
|
||||
Reference in New Issue
Block a user