Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/tests/test_pl_regon.doctest
diff options
context:
space:
mode:
authorDariusz Choruzy <darobial@gmail.com>2015-09-07 00:53:57 +0200
committerArthur de Jong <arthur@arthurdejong.org>2015-09-27 12:40:44 +0200
commit36217ac8d09f0de594b1ba9b17b435329c16548c (patch)
tree3df247f6bde4e54eae42e8f5fdc4f1753ff0ed87 /tests/test_pl_regon.doctest
parenta0cb61f7b1718b93e583e749c1483f0c6a5bdc3a (diff)
Add Polish REGON number
Diffstat (limited to 'tests/test_pl_regon.doctest')
-rw-r--r--tests/test_pl_regon.doctest104
1 files changed, 104 insertions, 0 deletions
diff --git a/tests/test_pl_regon.doctest b/tests/test_pl_regon.doctest
new file mode 100644
index 0000000..ecd4f69
--- /dev/null
+++ b/tests/test_pl_regon.doctest
@@ -0,0 +1,104 @@
+test_pl_regon.doctest - more detailed doctests for the stdnum.pl.regon module
+
+Copyright (C) 2015 Arthur de Jong
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA
+
+
+This file contains more detailed doctests for the stdnum.pl.regon module. It
+tries to validate a number of numbers that have been found online.
+
+>>> from stdnum.pl import regon
+>>> from stdnum.exceptions import *
+
+
+These have been found online and should all be valid numbers.
+
+>>> numbers = '''
+...
+... 000144992
+... 000262289
+... 000569734
+... 001123710
+... 001130740
+... 001130762
+... 001130785
+... 004611261
+... 010925233
+... 011370116
+... 015615046
+... 015831301
+... 017282442
+... 021425170
+... 021493503
+... 061245300
+... 080121017
+... 101286521
+... 101624716
+... 101702037
+... 120444729
+... 120812966
+... 122903064
+... 122989806
+... 140006787
+... 140124720
+... 140567178
+... 140906290
+... 141215688
+... 147244188
+... 160178314
+... 180405830
+... 180562050
+... 190248215
+... 190384415
+... 191305139
+... 192976380
+... 200197338
+... 220218697
+... 221997249
+... 241675487
+... 271747631
+... 276273209
+... 280002520
+... 292449593
+... 300613124
+... 302406613
+... 357126121
+... 360935507
+... 362392991
+... 362501144
+... 362509447
+... 362509460
+... 362509476
+... 362523660
+... 370418951
+... 370452988
+... 432740426
+... 570007868
+... 570135170
+... 570271370
+... 570860528
+... 572134252
+... 630679076
+... 632154969
+... 634389910
+... 670141210
+... 810033277
+... 812663628
+...
+... '''
+>>> [x for x in numbers.splitlines() if x and not regon.is_valid(x)]
+[]