Initial commit
This commit is contained in:
commit
5303986377
20 changed files with 3195 additions and 0 deletions
24
tests/test_norad.py
Normal file
24
tests/test_norad.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
"""Tests for the NORAD ID normaliser."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from odm import normalise_norad
|
||||
|
||||
|
||||
@pytest.mark.parametrize("raw,expected", [
|
||||
(None, None),
|
||||
("", None),
|
||||
(" ", None),
|
||||
(25544, "25544"),
|
||||
("25544", "25544"),
|
||||
(" 25544 ", "25544"),
|
||||
("123", "00123"), # zero-padded to 5
|
||||
(b"42", "00042"), # bytes accepted, zero-padded
|
||||
("A1234", "A1234"), # alphanumeric preserved verbatim
|
||||
("1998-067A", "1998-067A"), # hyphenated preserved verbatim
|
||||
("12345678", "12345678"), # >5 digits left intact
|
||||
])
|
||||
def test_normalise_norad(raw, expected):
|
||||
assert normalise_norad(raw) == expected
|
||||
Loading…
Add table
Add a link
Reference in a new issue