'Generic filtering test method.
According to the provided filters, this method:
- creates a new role assignment;
- asserts that list role assignments API reponds correctly;
- deletes the created role assignment.
:param filters: filters to be considered when listing role assignments.
Valid filters are: role_id, domain_id, project_id,
group_id, user_id and inherited_to_projects.'

def _test_get_role_assignments(self, **filters):

    test_assignment = self._set_default_assignment_attributes(**filters)
    self.assignment_api.create_grant(**test_assignment)
    expected_assignments = self._list_expected_role_assignments(**test_assignment)
    (response, query_url) = self.get_role_assignments(**test_assignment)
    self.assertValidRoleAssignmentListResponse(response, resource_url=query_url)
    self.assertEqual(len(expected_assignments), len(response.result.get('role_assignments')))
    for assignment in expected_assignments:
        self.assertRoleAssignmentInListResponse(response, assignment)
    self.assignment_api.delete_grant(**test_assignment)
