Write some tests for currency crud

This commit is contained in:
stijndcl 2022-07-03 19:26:30 +02:00
parent 8da0eb0b2a
commit 61128dda92
5 changed files with 112 additions and 10 deletions

View file

@ -48,3 +48,18 @@ def test_abbreviated_float_floors():
5.3k is 5300, but 5.3001k is 5300.1
"""
assert numbers.abbreviated_number("5.3001k") == 5300
def test_abbreviated_all():
"""Test abbreviated_number for the 'all' argument"""
assert numbers.abbreviated_number("all") == "all"
assert numbers.abbreviated_number("ALL") == "all"
def test_abbreviated_empty():
"""Test abbreviated_number for empty arguments"""
with pytest.raises(ValueError):
numbers.abbreviated_number("")
with pytest.raises(ValueError):
numbers.abbreviated_number(None)