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")