'Create the group memberships specified in the test plan.'

def create_group_memberships(self, group_pattern, test_data):

    for group_spec in group_pattern:
        group_value = test_data['groups'][group_spec['group']]['id']
        for user_index in group_spec['users']:
            user_value = test_data['users'][user_index]['id']
            self.identity_api.add_user_to_group(user_value, group_value)
    return test_data
