def test_update_group_attach_policies(ddbt): create_group(ddbt, group_name="sales", human_name="Sales") update_group_attach_policies(ddbt, group_name="sales", policy_names=["P1", "P2"]) group = describe_group(ddbt, group_name="sales") print(group)
def test_update_group_add_users(ddbt): create_user(ddbt, user_name="joe", human_name="Joe") create_user(ddbt, user_name="ann", human_name="Ann") create_group(ddbt, group_name="sales", human_name="Sales") update_group_add_users(ddbt, group_name="sales", user_names=["joe", "ann"]) group = describe_group(ddbt, group_name="sales") print(group)
def test_find_policy_names_matching_user(ddbt, generic_policy): create_user(ddbt, user_name="joe") create_user(ddbt, user_name="ann") create_group(ddbt, group_name="GroupA") update_group_add_users(ddbt, group_name="GroupA", user_names=["joe"]) create_policy(ddbt, policy_name="PolicyU", **generic_policy) create_policy(ddbt, policy_name="PolicyX", **generic_policy) create_policy(ddbt, policy_name="PolicyY", **generic_policy) create_policy(ddbt, policy_name="PolicyZ", **generic_policy) create_policy(ddbt, policy_name="PolicyI", **generic_policy) update_user_attach_policies(ddbt, "joe", policy_names=["PolicyU", "PolicyZ"]) update_user_inherit_group_policies(ddbt, "joe", group_name="GroupA", policy_names=["PolicyI"]) update_user_attach_policies(ddbt, "ann", policy_names=["PolicyY"]) assert find_policy_names_matching_user( ddbt, "joe") == ["PolicyI", "PolicyU", "PolicyZ"] assert find_policy_names_matching_user(ddbt, "ann") == ["PolicyY"]
def test_delete_group(ddbt): create_group(ddbt, group_name="sales", human_name="Sales") delete_group(ddbt, group_name="sales") group = describe_group(ddbt, group_name="sales") print(group)
def test_update_group(ddbt): create_group(ddbt, group_name="sales", human_name="Sales") update_group(ddbt, group_name="sales", human_name="joseph") group = describe_group(ddbt, group_name="sales") print(group)
def test_create_group(ddbt): create_group(ddbt, group_name="sales", human_name="Sales") groups = list_groups(ddbt) print(groups)