|
| 1 | +test_be_nn.doctest - more detailed doctests for stdnum.be.nn module |
| 2 | + |
| 3 | +Copyright (C) 2022 Arthur de Jong |
| 4 | + |
| 5 | +This library is free software; you can redistribute it and/or |
| 6 | +modify it under the terms of the GNU Lesser General Public |
| 7 | +License as published by the Free Software Foundation; either |
| 8 | +version 2.1 of the License, or (at your option) any later version. |
| 9 | + |
| 10 | +This library is distributed in the hope that it will be useful, |
| 11 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | +Lesser General Public License for more details. |
| 14 | + |
| 15 | +You should have received a copy of the GNU Lesser General Public |
| 16 | +License along with this library; if not, write to the Free Software |
| 17 | +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 18 | +02110-1301 USA |
| 19 | + |
| 20 | + |
| 21 | +This file contains more detailed doctests for the stdnum.be.nn module. It |
| 22 | +tries to test more corner cases and detailed functionality that is not |
| 23 | +really useful as module documentation. |
| 24 | + |
| 25 | +>>> from stdnum.be import nn |
| 26 | + |
| 27 | + |
| 28 | +Extra tests for getting birth date |
| 29 | + |
| 30 | + |
| 31 | +>>> nn.get_birth_date('85.07.30-033 28') |
| 32 | +datetime.date(1985, 7, 30) |
| 33 | +>>> nn.get_birth_date('17 07 30 033 84') |
| 34 | +datetime.date(2017, 7, 30) |
| 35 | +>>> nn.get_birth_date('12345678901') |
| 36 | +Traceback (most recent call last): |
| 37 | + ... |
| 38 | +InvalidChecksum: ... |
| 39 | +>>> nn.get_birth_date('00 00 01 003-64') # 2000-00-00 is not a valid date |
| 40 | +Traceback (most recent call last): |
| 41 | + ... |
| 42 | +InvalidComponent: ... |
0 commit comments