Fixed RET functionnality misbehaviour
This commit is contained in:
@@ -66,6 +66,7 @@ class TestAddConceptEvaluator(TestUsingMemoryBasedSheerka):
|
||||
def_concept.post = self.get_concept_part(post)
|
||||
if ret:
|
||||
def_concept.ret = self.get_concept_part(ret)
|
||||
|
||||
if bnf_def:
|
||||
def_concept.definition = bnf_def
|
||||
def_concept.definition_type = DEFINITION_TYPE_BNF
|
||||
@@ -174,6 +175,15 @@ class TestAddConceptEvaluator(TestUsingMemoryBasedSheerka):
|
||||
|
||||
assert AddConceptEvaluator.get_variables(context.sheerka, ret_val, ["a", "b"]) == ["a"]
|
||||
|
||||
def test_i_can_get_variables_when_keywords(self):
|
||||
sheerka, context = self.init_concepts()
|
||||
|
||||
def_concept = self.get_def_concept("condition pre").value.value
|
||||
name_to_use = AddConceptEvaluator.get_name_to_use(def_concept)
|
||||
concept_part = self.get_concept_part("pre")
|
||||
|
||||
assert AddConceptEvaluator.get_variables(context.sheerka, concept_part, name_to_use) == ["pre"]
|
||||
|
||||
def test_i_cannot_get_variables_from_python_node_when_name_has_only_one_token(self):
|
||||
ret_val = self.get_concept_part("isinstance(a, str)")
|
||||
context = self.get_context()
|
||||
|
||||
@@ -44,3 +44,4 @@ class TestRetEvaluator(TestUsingMemoryBasedSheerka):
|
||||
res = RetEvaluator().eval(context, ret_value)
|
||||
assert res.status
|
||||
assert sheerka.isinstance(res.body, expected)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user