Fixed RET functionnality misbehaviour

This commit is contained in:
2020-07-08 13:35:18 +02:00
parent c4399d631c
commit b768eaa95d
14 changed files with 113 additions and 29 deletions
@@ -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()