def METHOD_NAME(
    filter_sort_table_obj, op, column_name_and_val_pairs, res_len
):
    table, engine = filter_sort_table_obj
    db_function_lambda = database_functions[op]
    db_function = db_function_lambda([
        Equal([ColumnName([column_name]), value])
        for column_name, value in column_name_and_val_pairs
    ])
    relation = table.select()
    query = apply_db_function_as_filter(relation, db_function)
    record_list = execute_pg_query(engine, query)
    assert len(record_list) == res_len
    for record in record_list:
        val_func = op_to_python_func[op]
        args = [
            getattr(record, column_name) == value
            for column_name, value in column_name_and_val_pairs
        ]
        assert val_func(args)