Package cubicweb :: Package devtools :: Module repotest
[hide private]
[frames] | no frames]

Module repotest

source code

some utilities to ease repository testing

This module contains functions to initialize a new repository.

Classes [hide private]
  DumbOrderedDict
  DumbOrderedDict2
  RQLGeneratorTC
  BaseQuerierTC
  BasePlannerTC
  PartPlanInformation
Functions [hide private]
 
tuplify(list) source code
 
snippet_cmp(a, b) source code
 
test_plan(self, rql, expected, kwargs=None) source code
 
compare_steps(self, step, expected) source code
 
schema_eids_idx(schema)
return a dictionary mapping schema types to their eids so we can reread it from the fs instead of the db (too costly) between tests
source code
 
restore_schema_eids_idx(schema, schema_eids)
rebuild schema eid index
source code
 
_orig_insert_snippets(self, snippets, varexistsmap=None) source code
 
_orig_build_variantes(self, newsolutions) source code
 
_insert_snippets(self, snippets, varexistsmap=None) source code
 
_build_variantes(self, newsolutions) source code
 
_orig_check_permissions(self, rqlst)
return a dict defining "local checks", e.g. RQLExpression defined in the schema that should be inserted in the original query
source code
 
_orig_init_temp_table(self, table, selected, sol)
initialize sql schema and variable map for a temporary table which will be used to store result for the given rqlst
source code
 
_check_permissions(*args, **kwargs) source code
 
_dummy_check_permissions(self, rqlst) source code
 
_init_temp_table(self, table, selection, solution) source code
 
_orig_select_principal(scope, relations, _sort=<function <lambda> at 0x601ef50>)
given a list of rqlst relations, select one which will be used to represent an invariant variable (e.g. using on extremity of the relation instead of the variable's type table
source code
 
_select_principal(scope, relations) source code
 
_orig_merge_input_maps(self, *args) source code
 
_orig_choose_term(self, sourceterms) source code
 
_merge_input_maps(*args) source code
 
_choose_term(self, sourceterms) source code
 
do_monkey_patch() source code
 
undo_monkey_patch() source code
Function Details [hide private]

_orig_check_permissions(self, rqlst)

source code 

return a dict defining "local checks", e.g. RQLExpression defined in the schema that should be inserted in the original query

solutions where a variable has a type which the user can't definitly read are removed, else if the user may read it (eg if an rql expression is defined for the "read" permission of the related type), the local checks dict for the solution is updated

return a dict with entries for each different local check necessary, with associated solutions as value. A local check is defined by a list of 2-uple, with variable name as first item and the necessary rql expression as second item for each variable which has to be checked. So solutions which don't require local checks will be associated to the empty tuple key.

note: rqlst should not have been simplified at this point