Added basic implentation for where

This commit is contained in:
2020-02-05 18:47:20 +01:00
parent a5a721094b
commit afc1e22949
35 changed files with 864 additions and 320 deletions
+20 -20
View File
@@ -116,23 +116,23 @@ class TestPythonEvaluator(TestUsingMemoryBasedSheerka):
assert not evaluated.status
assert evaluated.body.body.args[0] == "'int' object has no attribute 'name'"
@pytest.mark.parametrize("text, concept_key, concept_id, use_concept", [
("__C__key__C__", "key", None, False),
("__C__key__id__C__", "key", "id", False),
("__C__USE_CONCEPT__key__id__C__", "key", "id", True),
("__C__USE_CONCEPT__key__id__C__", "key", "id", True),
])
def test_i_can_resolve_name(self, text, concept_key, concept_id, use_concept):
context = self.get_context()
assert PythonEvaluator().resolve_name(context, text) == (concept_key, concept_id, use_concept)
@pytest.mark.parametrize("text", [
"__C__",
"__C__key",
"__C__key____",
"__C____",
"__C__USE_CONCEPT__",
])
def test_i_cannot_resolve_name(self, text):
context = self.get_context()
assert PythonEvaluator().resolve_name(context, text) is None
# @pytest.mark.parametrize("text, concept_key, concept_id, use_concept", [
# ("__C__key__C__", "key", None, False),
# ("__C__key__id__C__", "key", "id", False),
# ("__C__USE_CONCEPT__key__id__C__", "key", "id", True),
# ("__C__USE_CONCEPT__key__id__C__", "key", "id", True),
# ])
# def test_i_can_resolve_name(self, text, concept_key, concept_id, use_concept):
# context = self.get_context()
# assert PythonEvaluator().resolve_name(context, text) == (concept_key, concept_id, use_concept)
#
# @pytest.mark.parametrize("text", [
# "__C__",
# "__C__key",
# "__C__key____",
# "__C____",
# "__C__USE_CONCEPT__",
# ])
# def test_i_cannot_resolve_name(self, text):
# context = self.get_context()
# assert PythonEvaluator().resolve_name(context, text) is None