Exemplo n.º 1
0
def test_replace_cpu_configuration_without_fraction():

    changed_resources = template.replace_cpu_configuration(
        RESOURCES_TO_BE_CHANGED,
        new_cpu_number="1",
        current_cpu_number="20",
        fraction=None)

    assert changed_resources.get("requests").get("cpu") == "0.5"
    assert changed_resources.get("limits").get("cpu") == "0.5"
Exemplo n.º 2
0
def test_replace_cpu_configuration_with_fraction():

    changed_resources = template.replace_cpu_configuration(
        RESOURCES_TO_BE_CHANGED,
        new_cpu_number="2",
        current_cpu_number="20",
        fraction=0.5,
        system_required_min="0.5",
        system_required_percent="0.5")

    assert changed_resources.get("requests").get("cpu") == "0.75"
    assert changed_resources.get("limits").get("cpu") == "0.75"