kiwi-el8/test/unit/utils/size_test.py
David Cassany 4b3a105026
Re-structure unit tests folders
This commit relocates unit tests to a folder structure that matches
the source code structure.

Fixes #1128
2019-10-21 14:00:05 +02:00

18 lines
508 B
Python

from pytest import raises
from kiwi.utils.size import StringToSize
from kiwi.exceptions import KiwiSizeError
class TestStringToSize:
def test_to_bytes(self):
assert StringToSize.to_bytes('1m') == 1048576
assert StringToSize.to_bytes('1M') == 1048576
assert StringToSize.to_bytes('1g') == 1073741824
assert StringToSize.to_bytes('1G') == 1073741824
def test_to_bytes_wrong_format(self):
with raises(KiwiSizeError):
StringToSize.to_bytes('1mb')