testdata/test/test_utils.py

24 lines
524 B
Python
Raw Normal View History

2024-08-04 17:56:53 +00:00
from pytest import raises
from testdata.utils import convert_to_bytes
def test_convert_to_bytes():
test_values = {
('0', 0),
('32', 32),
('10_000', 10000),
('999999999999999999', 999999999999999999),
}
for input, expected_output in test_values:
assert convert_to_bytes(input) == expected_output
test_exceptions = {
('9E3', ValueError)
}
for input, exception in test_exceptions:
with raises(exception):
convert_to_bytes(input)