refactor: testing

Redid testing structure, added tests and changed some tests.

ref: N25B-301
This commit is contained in:
2025-11-21 17:03:40 +01:00
parent 97f5f5c74d
commit 5fb923e20d
20 changed files with 661 additions and 533 deletions

View File

@@ -0,0 +1,26 @@
import pytest
from pydantic import ValidationError
from control_backend.schemas.ri_message import RIEndpoint, RIMessage, SpeechCommand
def valid_command_1():
return SpeechCommand(data="Hallo?")
def invalid_command_1():
return RIMessage(endpoint=RIEndpoint.PING, data="Hello again.")
def test_valid_speech_command_1():
command = valid_command_1()
RIMessage.model_validate(command)
SpeechCommand.model_validate(command)
def test_invalid_speech_command_1():
command = invalid_command_1()
RIMessage.model_validate(command)
with pytest.raises(ValidationError):
SpeechCommand.model_validate(command)