Fixes: https://tracker.ceph.com/issues/57609
Signed-off-by: Tim Serong <tserong@suse.com>
"""
SUFFIXES = (
- ["MB", "GB", "TB"],
- ["M", "G", "T"],
- [1e+6, 1e+9, 1e+12]
+ ["KB", "MB", "GB", "TB"],
+ ["K", "M", "G", "T"],
+ [1e+3, 1e+6, 1e+9, 1e+12]
)
supported_suffixes = SUFFIXES[0] + SUFFIXES[1]
assert matcher.low[0] == '50'
assert matcher.low[1] == 'GB'
+ def test_to_byte_KB(self):
+ """ I doubt anyone ever thought we'd need to understand KB """
+
+ ret = drive_selection.SizeMatcher('size', '4K').to_byte(('4', 'KB'))
+ assert ret == 4 * 1e+3
+
def test_to_byte_GB(self):
""" Pretty nonesense test.."""