8000 vatin: Add a few more tests for is_valid · unho/python-stdnum@7348c7a · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7348c7a

Browse files
unhoarthurdejong
authored andcommitted
vatin: Add a few more tests for is_valid
See arthurdejong#316
1 parent fa62ea3 commit 7348c7a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/test_vatin.doctest

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,21 @@ InvalidComponent: ...
7878
Traceback (most recent call last):
7979
...
8080
InvalidComponent: ...
81+
82+
83+
Check is_valid for several scenarios:
84+
85+
>>> vatin.is_valid('FR 40 303 265 045')
86+
True
87+
>>> vatin.is_valid('FR 40 303')
88+
False
89+
>>> vatin.is_valid('FR')
90+
False
91+
>>> vatin.is_valid('')
92+
False
93+
>>> vatin.is_valid('00')
94+
False
95+
>>> vatin.is_valid('XX')
96+
False
97+
>>> vatin.is_valid('US')
98+
False

0 commit comments

Comments
 (0)
0