From dcdb3250e43caaa00b0d723b9ca0b08d6ae657a0 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Sat, 19 Feb 2022 14:00:59 -0600 Subject: [PATCH] Added unittest for utils module --- test/test_utils.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/test_utils.py diff --git a/test/test_utils.py b/test/test_utils.py new file mode 100644 index 0000000..6cfe80c --- /dev/null +++ b/test/test_utils.py @@ -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 \ No newline at end of file