lemoncurry/lemonshort/tests/convert.py

33 lines
621 B
Python
Raw Permalink Normal View History

from .. import convert
def test_to_python():
samples = {
2023-08-10 02:52:37 -04:00
"A": 0,
"B": 1,
"Y": 24,
"a": 26,
"b": 27,
"y": 50,
"BA": 52,
"BAB": 2705,
}
converter = convert.AbcIdConverter()
for abc, id in samples.items():
assert converter.to_python(abc) == id
def test_id_to_abc():
samples = {
2023-08-10 02:52:37 -04:00
1: "B",
24: "Y",
26: "a",
52: "BA",
78: "Ba",
104: "CA",
130: "Ca",
}
converter = convert.AbcIdConverter()
for id, abc in samples.items():
assert converter.to_url(id) == abc