kin: BATON-SEC-003-backend_dev
This commit is contained in:
parent
8629f3e40b
commit
3a2ec11cc7
13 changed files with 593 additions and 125 deletions
|
|
@ -46,11 +46,11 @@ def test_register_request_empty_uuid():
|
|||
def test_register_request_name_max_length():
|
||||
"""name longer than 100 chars raises ValidationError."""
|
||||
with pytest.raises(ValidationError):
|
||||
RegisterRequest(uuid="some-uuid", name="x" * 101)
|
||||
RegisterRequest(uuid="550e8400-e29b-41d4-a716-446655440000", name="x" * 101)
|
||||
|
||||
|
||||
def test_register_request_name_exactly_100():
|
||||
req = RegisterRequest(uuid="some-uuid", name="x" * 100)
|
||||
req = RegisterRequest(uuid="550e8400-e29b-41d4-a716-446655440000", name="x" * 100)
|
||||
assert len(req.name) == 100
|
||||
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ def test_signal_request_valid():
|
|||
|
||||
def test_signal_request_no_geo():
|
||||
req = SignalRequest(
|
||||
user_id="some-uuid",
|
||||
user_id="550e8400-e29b-41d4-a716-446655440000",
|
||||
timestamp=1742478000000,
|
||||
geo=None,
|
||||
)
|
||||
|
|
@ -136,9 +136,9 @@ def test_signal_request_empty_user_id():
|
|||
def test_signal_request_timestamp_zero():
|
||||
"""timestamp must be > 0."""
|
||||
with pytest.raises(ValidationError):
|
||||
SignalRequest(user_id="some-uuid", timestamp=0)
|
||||
SignalRequest(user_id="550e8400-e29b-41d4-a716-446655440000", timestamp=0)
|
||||
|
||||
|
||||
def test_signal_request_timestamp_negative():
|
||||
with pytest.raises(ValidationError):
|
||||
SignalRequest(user_id="some-uuid", timestamp=-1)
|
||||
SignalRequest(user_id="550e8400-e29b-41d4-a716-446655440000", timestamp=-1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue