forked from 00dani/lemoncurry
Remove django-shorturls with my own implementation, since it's incompatible with Django 2 and unmaintained
This commit is contained in:
parent
27e0cb9a34
commit
098284a617
18 changed files with 252 additions and 184 deletions
0
lemonshort/tests/__init__.py
Normal file
0
lemonshort/tests/__init__.py
Normal file
30
lemonshort/tests/convert.py
Normal file
30
lemonshort/tests/convert.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
from .. import convert
|
||||
|
||||
|
||||
def test_abc_to_id():
|
||||
samples = {
|
||||
'A': 0,
|
||||
'B': 1,
|
||||
'Y': 24,
|
||||
'a': 26,
|
||||
'b': 27,
|
||||
'y': 50,
|
||||
'BA': 52,
|
||||
'BAB': 2705,
|
||||
}
|
||||
for abc, id in samples.items():
|
||||
assert convert.abc_to_id(abc) == id
|
||||
|
||||
|
||||
def test_id_to_abc():
|
||||
samples = {
|
||||
1: 'B',
|
||||
24: 'Y',
|
||||
26: 'a',
|
||||
52: 'BA',
|
||||
78: 'Ba',
|
||||
104: 'CA',
|
||||
130: 'Ca',
|
||||
}
|
||||
for id, abc in samples.items():
|
||||
assert convert.id_to_abc(id) == abc
|
Loading…
Add table
Add a link
Reference in a new issue