lists.arthurdejong.org
RSS feed

python-stdnum branch master updated. 1.20-19-g0218601

[Date Prev][Date Next] [Thread Prev][Thread Next]

python-stdnum branch master updated. 1.20-19-g0218601



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-stdnum".

The branch, master has been updated
       via  02186014334be2cd2d8899835b8380ba1af74b7b (commit)
      from  bcd5018ee6842a13b07b168c6bc01c5d28c87406 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://arthurdejong.org/git/python-stdnum/commit/?id=02186014334be2cd2d8899835b8380ba1af74b7b

commit 02186014334be2cd2d8899835b8380ba1af74b7b
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sun Nov 17 12:38:16 2024 +0100

    Allow Uruguay RUT number starting with 22

diff --git a/stdnum/uy/rut.py b/stdnum/uy/rut.py
index baf6322..769578d 100644
--- a/stdnum/uy/rut.py
+++ b/stdnum/uy/rut.py
@@ -87,7 +87,7 @@ def validate(number):
         raise InvalidLength()
     if not isdigits(number):
         raise InvalidFormat()
-    if number[:2] < '01' or number[:2] > '21':
+    if number[:2] < '01' or number[:2] > '22':
         raise InvalidComponent()
     if number[2:8] == '000000':
         raise InvalidComponent()
diff --git a/tests/test_uy_rut.doctest b/tests/test_uy_rut.doctest
index 0458389..784690e 100644
--- a/tests/test_uy_rut.doctest
+++ b/tests/test_uy_rut.doctest
@@ -47,7 +47,7 @@ InvalidFormat: ...
 Traceback (most recent call last):
     ...
 InvalidComponent: ...
->>> rut.validate('221599340019')  # invalid first two digits
+>>> rut.validate('991599340011')  # invalid first two digits
 Traceback (most recent call last):
     ...
 InvalidComponent: ...
@@ -269,6 +269,7 @@ These have been found online and should all be valid 
numbers.
 ... 217132510011
 ... 217142440016
 ... 217149110011
+... 220018800014
 ...
 ... '''
 >>> [x for x in numbers.splitlines() if x and not rut.is_valid(x)]

-----------------------------------------------------------------------

Summary of changes:
 stdnum/uy/rut.py          | 2 +-
 tests/test_uy_rut.doctest | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
python-stdnum