Example #1
0
def order_role_searches_list_foo_before_bar(step, order, first, second):
    roleModel = RoleModel()

    role_list = roleModel.get_all_list(sort_direction = order,
                                       sort_field = "name")

    # check that the index of "first" is before "second"
    check_first_before_second("name", first, second, role_list)
Example #2
0
def check_roles_exist(hashes):
    roleModel = RoleModel()
    role_list = roleModel.get_all_list()

    # walk through all the expected roles and make sure it has them all
    # note, it doesn't check that ONLY these roles exist.  That should be a different
    # method.
    for role in hashes:
        role_name = role["name"]
        found_perm = [x for x in role_list if x[ns("name")] == role_name]

        assert len(found_perm) == 1, "Expected to find role name %s in:\n%s" % (role_name,
                                                                                   jstr(role_list))