def test_update_lag(placeboify, maybe_sleep, dependencies):
    client = placeboify.client("directconnect")
    status_before = lag_module.lag_status(client=client, lag_id=dependencies.lag_2.get("lag_id"))
    lag_module.update_lag(client,
                          lag_id=dependencies.lag_2.get("lag_id"),
                          lag_name="ansible_lag_2_update",
                          min_links=0,
                          wait=False,
                          wait_timeout=0,
                          num_connections=1)
    status_after = lag_module.lag_status(client=client, lag_id=dependencies.lag_2.get("lag_id"))
    assert status_before != status_after

    # remove the lag name from the statuses and verify it was the only thing changed
    del status_before['lagName']
    del status_after['lagName']
    assert status_before == status_after
def test_lag_status(placeboify, maybe_sleep, dependencies):
    client = placeboify.client("directconnect")
    status = lag_module.lag_status(client, lag_id=dependencies.lag_1.get("lag_id"))
    assert status.get("lagId") == dependencies.lag_1.get("lag_id")
    assert status.get("lagName") == "ansible_lag_1"
def test_lag_changed_true_no(placeboify, maybe_sleep, dependencies):
    client = placeboify.client("directconnect")
    status = lag_module.lag_status(client=client, lag_id=dependencies.lag_1.get("lag_id"))
    assert not lag_module.lag_changed(status, "ansible_lag_1", 0)
def test_lag_changed_true(placeboify, maybe_sleep, dependencies):
    client = placeboify.client("directconnect")
    status = lag_module.lag_status(client=client, lag_id=dependencies.lag_1.get("lag_id"))
    assert lag_module.lag_changed(status, "new_name", 1)