Added unittest for utils module

This commit is contained in:
Manuel Cortez 2022-02-19 14:00:59 -06:00
parent 16dd77760f
commit dcdb3250e4
No known key found for this signature in database
GPG Key ID: 262CC30FA01B5CBF

11
test/test_utils.py Normal file
View File

@ -0,0 +1,11 @@
import pytest
from updater import utils
@pytest.mark.parametrize("number_of_bytes, expected_result", [
(11, "11"),
(20000000, "19.07Mb"),
(2000000000, "1.86Gb"),
])
def test_convert_bytes(number_of_bytes, expected_result):
result = utils.convert_bytes(number_of_bytes)
assert result == expected_result