Skip to content

Commit

Permalink
docs and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nvmbrasserie committed Nov 20, 2024
1 parent 7c82334 commit 1ec3084
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions docs/stdnum.re.ogrn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
stdnum.ru.ogrn
=============

.. automodule:: stdnum.ru.ogrn
:members:
9 changes: 4 additions & 5 deletions tests/test_ru_ogrn.doctest
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ This is a list of OGRNs that should all be valid numbers:
... "1022300001811", "1020500003919", "1022300003703",
... "1022300000502", "1022200531484", "1022200525819"
... ]
>>> all(ogrn.is_valid(x) for x in valid_numbers)
>>> all(ogrn.validate(x) for x in valid_numbers)
True

These are some numbers that should be invalid:
Expand All @@ -46,19 +46,18 @@ These are some numbers that should be invalid:
... "1027739552", "", "1027739",
... "11677", "315774600002662123"
... ]
>>> all(not ogrn.is_valid(x) for x in invalid_numbers)
>>> all(not ogrn.validate(x) for x in invalid_numbers)
True

Testing normalization of OGRN strings:

>>> ogrn.normalize("1027739552642")
'1027739552642'
>>> ogrn.normalize("OGRN 1027739552642")
'1027739552642'
>>> ogrn.normalize("102773955")
>>> ogrn.normalize("10277395587984375943")


Ensure OGRN can be formatted as expected:

>>> ogrn.format("1027739552642")
>>> ogrn.format(" 1027739552642 ")
'1027739552642'

0 comments on commit 1ec3084

Please sign in to comment.