First implementation of questions management

This commit is contained in:
2020-08-14 08:16:33 +02:00
parent e84b394da2
commit 351c16f946
47 changed files with 1582 additions and 400 deletions
+11 -2
View File
@@ -15,9 +15,9 @@ class BaseTest:
def get_context(self, sheerka=None, eval_body=False, eval_where=False):
context = ExecutionContext("test", Event(), sheerka or self.get_sheerka(), BuiltinConcepts.TESTING, None)
if eval_body:
context.local_hints.add(BuiltinConcepts.EVAL_BODY_REQUESTED)
context.protected_hints.add(BuiltinConcepts.EVAL_BODY_REQUESTED)
if eval_where:
context.local_hints.add(BuiltinConcepts.EVAL_WHERE_REQUESTED)
context.protected_hints.add(BuiltinConcepts.EVAL_WHERE_REQUESTED)
return context
@@ -78,6 +78,15 @@ class BaseTest:
return sheerka, context, *result
@staticmethod
def get_concept_instance(sheerka, concept, **kwargs):
instance = sheerka.new(concept.key if isinstance(concept, Concept) else concept)
for i, var in enumerate(instance.metadata.variables):
if var[0] in kwargs:
instance.metadata.variables[i] = (var[0], kwargs[var[0]])
return instance
@staticmethod
def retval(obj, who="who", status=True):
"""ret_val"""