feat: complete Phases 2 to 5 inclusive - Access Core, Web Cockpit, Hardware enqueuing, Optical Scanner and QA (v0.5.0-beta)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import pytest
|
||||
from pydantic import ValidationError
|
||||
from app.schemas.auth_schema import LoginRequest, LoginResponse, UserSessionDTO
|
||||
from app.schemas.workstation_schema import LaneModuleDTO, WorkstationStatusResponse
|
||||
|
||||
|
||||
def test_login_request_valid():
|
||||
req = LoginRequest(username="guardia", password="secret_password", workstation_name="TABLET_01")
|
||||
assert req.username == "guardia"
|
||||
assert req.password == "secret_password"
|
||||
assert req.workstation_name == "TABLET_01"
|
||||
|
||||
|
||||
def test_login_request_empty_fields_raises_validation_error():
|
||||
with pytest.raises(ValidationError):
|
||||
LoginRequest(username="", password="")
|
||||
|
||||
|
||||
def test_workstation_status_response_schema():
|
||||
mod = LaneModuleDTO(modulo_id=100004, nombre="ENTRADA VISITAS", address=98, es_entrada=True)
|
||||
status = WorkstationStatusResponse(
|
||||
workstation_name="CFT-DESK",
|
||||
is_control_post=True,
|
||||
workstation_id=100001,
|
||||
modules=[mod],
|
||||
)
|
||||
assert status.is_control_post is True
|
||||
assert len(status.modules) == 1
|
||||
assert status.modules[0].modulo_id == 100004
|
||||
Reference in New Issue
Block a user