Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_human_readable_mebi_bytes():
assert human_readable_bytes(2048 * 1024) == "2.00MiB"
def test_human_readable_giga_bytes():
assert human_readable_bytes(2048 * 1024 * 1024) == "2.00GiB"
def test_human_readable_bytes_0_digits():
assert human_readable_bytes(0, digits=0) == "0B"
def test_human_readable_tera_bytes():
assert human_readable_bytes(2048 * 1024 * 1024 * 1024) == "2.00TiB"
def test_human_readable_bytes():
assert human_readable_bytes(0) == "0.00B"
def test_human_readable_kibi_bytes():
assert human_readable_bytes(2048) == "2.00KiB"
def test_human_readable_bytes_with_postfix():
assert human_readable_bytes(0, digits=0, delim=" ", postfix="/s") == "0 B/s"
def test_human_readable_bytes_all_kwargs():
assert human_readable_bytes(1024, digits=0, delim=" ", postfix="/s") == "1 KiB/s"
def test_human_readable_bytes_space_delim():
assert human_readable_bytes(0, digits=0, delim=" ") == "0 B"