Exemple #1
0
def test_modify_group_memberships_group_removed(get_memberships,
                                                delete_memberships):
    delete_memberships.return_value = True
    result = oci_user.modify_group_memberships(
        identity_client, [], get_user(),
        get_module(dict({'compartment_id': 'test_compartment'})))
    assert result is True
Exemple #2
0
def test_modify_group_memberships_no_changes():
    result = oci_user.modify_group_memberships(
        identity_client,
        None,
        get_user(),
        get_module(dict({"compartment_id": "test_compartment"})),
    )
    assert result is False
Exemple #3
0
def test_modify_group_memberships_group_updated(get_memberships,
                                                update_group_memberships):
    get_memberships.return_value = [
        'ocid1.user.oc1..xdf', 'ocid1.user.oc1..vgd'
    ]
    update_group_memberships.return_value = True
    result = oci_user.modify_group_memberships(
        identity_client, ['test_group_1', 'test_group_2'], get_user(),
        get_module(dict({'compartment_id': 'test_compartment'})))
    assert result is True
Exemple #4
0
def test_modify_group_memberships_group_updated(get_memberships,
                                                update_group_memberships):
    get_memberships.return_value = [
        "ocid1.user.oc1..xdf", "ocid1.user.oc1..vgd"
    ]
    update_group_memberships.return_value = True
    result = oci_user.modify_group_memberships(
        identity_client,
        ["test_group_1", "test_group_2"],
        get_user(),
        get_module(dict({"compartment_id": "test_compartment"})),
    )
    assert result is True