from validators import normalize_phone, format_phone_display, is_valid_name def test_normalize_ru_8(): assert normalize_phone("89991234567") == "+79991234567" def test_normalize_ru_formatted(): assert normalize_phone("+7 (999) 123-45-67") == "+79991234567" def test_normalize_international(): assert normalize_phone("+380501234567") == "+380501234567" def test_normalize_invalid(): assert normalize_phone("12345") is None assert normalize_phone("abcdef") is None def test_format_phone_display(): assert format_phone_display("+79991234567") == "+7 (999) 123-45-67" assert format_phone_display("+380501234567") == "+380501234567" # межд. как есть def test_name_valid(): assert is_valid_name("Иван-Петров") assert is_valid_name("John") def test_name_invalid(): assert not is_valid_name("Иван123") assert not is_valid_name("!!!") assert not is_valid_name("a")