Fixed some misbehaviours regarding question() + added #import functionality when restoring
This commit is contained in:
@@ -119,7 +119,7 @@ class TestAddConceptEvaluator(TestUsingMemoryBasedSheerka):
|
||||
def_concept_return_value = self.get_def_concept(
|
||||
name="x plus y",
|
||||
where=self.pretval(Concept("u is a v").def_var("u").def_var("v"), source="x is a number"),
|
||||
body=self.pretval(Concept("add a b").def_var("a").def_var("b"), source="add x y"),)
|
||||
body=self.pretval(Concept("add a b").def_var("a").def_var("b"), source="add x y"), )
|
||||
|
||||
evaluated = AddConceptEvaluator().eval(context, def_concept_return_value)
|
||||
|
||||
@@ -186,8 +186,10 @@ class TestAddConceptEvaluator(TestUsingMemoryBasedSheerka):
|
||||
|
||||
@pytest.mark.parametrize("expression, name, expected", [
|
||||
("isinstance(a, str)", "a b", {"a"}),
|
||||
("a.location=b", "a is in b", {"a", "b"}),
|
||||
("a.location=b", "'a' is in b", {"b"}),
|
||||
("a.location = b", "a is in b", {"a", "b"}),
|
||||
("a.location = b", "'a' is in b", {"b"}),
|
||||
("date.today()", "what is the date", set()),
|
||||
("a.location", "where is a", {"a"})
|
||||
])
|
||||
def test_i_can_get_variables_from_python_node_when_long_name(self, expression, name, expected):
|
||||
ret_val = self.get_concept_part(expression)
|
||||
|
||||
Reference in New Issue
Block a user