Skip to content

Commit abea471

Browse files
add tests
1 parent 5808f70 commit abea471

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

tests/i18n/test_inn.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
"""Test i18n/inn."""
2+
3+
# external
4+
import pytest
5+
6+
# local
7+
from src.validators import ValidationError
8+
from src.validators.i18n import ru_inn
9+
10+
11+
@pytest.mark.parametrize(
12+
("value",),
13+
[
14+
("2222058686",),
15+
("7709439560",),
16+
("5003052454",),
17+
("7730257499",),
18+
("3664016814",),
19+
("026504247480",),
20+
("780103209220",),
21+
("7707012148",),
22+
("140700989885",),
23+
("774334078053",),
24+
],
25+
)
26+
def test_returns_true_on_valid_ru_inn(value: str):
27+
"""Test returns true on valid russian individual tax number"""
28+
assert ru_inn(value)
29+
30+
31+
@pytest.mark.parametrize(
32+
("value",),
33+
[
34+
("2222058687",),
35+
("7709439561",),
36+
("5003052453",),
37+
("7730257490",),
38+
("3664016815",),
39+
("026504247481",),
40+
("780103209222",),
41+
("7707012149",),
42+
("140700989886",),
43+
("774334078054",),
44+
],
45+
)
46+
def test_returns_false_on_valid_ru_inn(value: str):
47+
"""Test returns true on valid russian individual tax number"""
48+
assert isinstance(ru_inn(value), ValidationError)

0 commit comments

Comments
 (0)