초기 커밋
This commit is contained in:
18
tests/unit/test_validators.py
Normal file
18
tests/unit/test_validators.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from app.utils.validators import is_valid_device_uid, is_valid_email
|
||||
|
||||
|
||||
def test_valid_device_uid() -> None:
|
||||
assert is_valid_device_uid("device-001")
|
||||
assert is_valid_device_uid("SENSOR_ABC_123")
|
||||
assert not is_valid_device_uid("ab") # too short
|
||||
assert not is_valid_device_uid("device uid") # space
|
||||
assert not is_valid_device_uid("")
|
||||
|
||||
|
||||
def test_valid_email() -> None:
|
||||
assert is_valid_email("user@example.com")
|
||||
assert is_valid_email("test.user+tag@domain.co.kr")
|
||||
assert not is_valid_email("not-an-email")
|
||||
assert not is_valid_email("@domain.com")
|
||||
Reference in New Issue
Block a user