コード例 #1
0
def test_sum_mem_resources_example_list():
    mem_resources = ["10Gi", "34Mi", "50Mi", "950Mi", "50Ki", "60Ei"]
    expected_result = "60EiB 11GiB 10MiB 50KiB"

    result = view.sum_mem_resources(mem_resources)

    assert result == expected_result
コード例 #2
0
def test_sum_mem_resources_example_with_mixed():
    mem_resources = ["50Ki", "1000K", "1024", "1000000", "52Ki"]
    expected_result = "2MiB 8KiB"

    result = view.sum_mem_resources(mem_resources)

    assert result == expected_result
コード例 #3
0
def test_sum_mem_resources_empty_list():
    mem_resources = []
    expected_result = "0KiB"

    result = view.sum_mem_resources(mem_resources)

    assert result == expected_result