Ejemplo n.º 1
0
def test_format_bytes():
    assert format_bytes(50) == "50 B"
    assert format_bytes(1024) == "1.00 KB"
    assert format_bytes(3000) == "2.93 KB"
    assert format_bytes(30000) == "29.30 KB"
    assert format_bytes(3000000) == "2.86 MB"
    assert format_bytes(3000000000) == "2.79 GB"
    assert format_bytes(3000000000000) == "2.73 TB"

    assert format_bytes(3000000000000, units=["B", "KB", "MB", "GB"]) == "2793.97 GB"
Ejemplo n.º 2
0
def test_format_bytes():
    assert format_bytes(50) == '50 B'
    assert format_bytes(1024) == '1.00 KB'
    assert format_bytes(3000) == '2.93 KB'
    assert format_bytes(30000) == '29.30 KB'
    assert format_bytes(3000000) == '2.86 MB'
    assert format_bytes(3000000000) == '2.79 GB'
    assert format_bytes(3000000000000) == '2.73 TB'

    assert format_bytes(3000000000000, units=['B', 'KB', 'MB', 'GB']) == '2793.97 GB'
Ejemplo n.º 3
0
def test_format_bytes():
    assert format_bytes(50) == '50 B'
    assert format_bytes(1024) == '1.00 KB'
    assert format_bytes(3000) == '2.93 KB'
    assert format_bytes(30000) == '29.30 KB'
    assert format_bytes(3000000) == '2.86 MB'
    assert format_bytes(3000000000) == '2.79 GB'
    assert format_bytes(3000000000000) == '2.73 TB'

    assert format_bytes(3000000000000, units=['B', 'KB', 'MB',
                                              'GB']) == '2793.97 GB'