How to use the aria2p.utils.human_readable_bytes function in aria2p

To help you get started, we’ve selected a few aria2p examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_mebi_bytes():
    assert human_readable_bytes(2048 * 1024) == "2.00MiB"
github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_giga_bytes():
    assert human_readable_bytes(2048 * 1024 * 1024) == "2.00GiB"
github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_bytes_0_digits():
    assert human_readable_bytes(0, digits=0) == "0B"
github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_tera_bytes():
    assert human_readable_bytes(2048 * 1024 * 1024 * 1024) == "2.00TiB"
github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_bytes():
    assert human_readable_bytes(0) == "0.00B"
github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_kibi_bytes():
    assert human_readable_bytes(2048) == "2.00KiB"
github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_bytes_with_postfix():
    assert human_readable_bytes(0, digits=0, delim=" ", postfix="/s") == "0 B/s"
github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_bytes_all_kwargs():
    assert human_readable_bytes(1024, digits=0, delim=" ", postfix="/s") == "1 KiB/s"
github pawamoy / aria2p / tests / test_utils.py View on Github external
def test_human_readable_bytes_space_delim():
    assert human_readable_bytes(0, digits=0, delim=" ") == "0 B"