Backend and frontend testing stacks (pytest + vitest) and a few initial tests.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import pytest
|
||||
|
||||
from apps.accounts.services.phone import normalize_phone_number
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"raw,expected",
|
||||
[
|
||||
("+966512345678", "+966512345678"),
|
||||
("0512345678", "+966512345678"),
|
||||
("512345678", "+966512345678"),
|
||||
("00966512345678", "+966512345678"),
|
||||
],
|
||||
)
|
||||
def test_normalize_phone_number_valid(raw, expected):
|
||||
assert normalize_phone_number(raw) == expected
|
||||
|
||||
|
||||
def test_normalize_phone_number_invalid():
|
||||
with pytest.raises(ValueError):
|
||||
normalize_phone_number("12345")
|
||||
Reference in New Issue
Block a user