@@ -32,35 +32,39 @@ start with a zero.
32
32
>>> idnr.validate('116574261809')
33
33
Traceback (most recent call last):
34
34
...
35
- InvalidLength: .. .
35
+ stdnum.exceptions. InvalidLength: The number has an invalid length .
36
36
>>> idnr.validate('A6574261809')
37
37
Traceback (most recent call last):
38
38
...
39
- InvalidFormat: .. .
39
+ stdnum.exceptions. InvalidFormat: The number has an invalid format .
40
40
>>> idnr.validate('01234567896')
41
41
Traceback (most recent call last):
42
42
...
43
- InvalidFormat: .. .
43
+ stdnum.exceptions. InvalidFormat: The number has an invalid format .
44
44
45
45
46
46
The first 10 digits of the IdNr is supposed to contain exactly one digit
47
47
twice (or three times since 2016) and all other digits in the number can only
48
48
appear once. This tries to catch some corner cases. Note that only the first
49
49
10 digits are considered for this.
50
50
51
- >>> idnr.validate('1234567890 3 ') # each digit once
51
+ >>> idnr.validate('12345678903 ') # each digit once
52
52
Traceback (most recent call last):
53
53
...
54
- InvalidFormat: .. .
55
- >>> idnr.validate('1123456789 0 ') # one digit twice
54
+ stdnum.exceptions. InvalidFormat: The number has an invalid format .
55
+ >>> idnr.validate('11234567890 ') # one digit twice
56
56
'11234567890'
57
- >>> idnr.validate('1112345678 6 ') # one digit three times
57
+ >>> idnr.validate('11123456786 ') # one digit three times
58
58
'11123456786'
59
+ >>> idnr.validate('1112345678 6') # one digit three times
60
+ Traceback (most recent call last):
61
+ ...
62
+ stdnum.exceptions.InvalidLength: The number has an invalid length.
59
63
>>> idnr.validate('1111234567 8') # one digit four times
60
64
Traceback (most recent call last):
61
65
...
62
- InvalidFormat: .. .
66
+ stdnum.exceptions.InvalidLength: The number has an invalid length .
63
67
>>> idnr.validate('1122345678 5') # two digits more than once
64
68
Traceback (most recent call last):
65
69
...
66
- InvalidFormat: .. .
70
+ stdnum.exceptions.InvalidLength: The number has an invalid length .
0 commit comments