Added mandatory evaluator steps

This commit is contained in:
2019-12-22 19:51:17 +01:00
parent a683d4cd42
commit 5c90b07e1a
13 changed files with 210 additions and 63 deletions
+15 -15
View File
@@ -207,21 +207,21 @@ as:
assert sheerka.isinstance(res[0].value, BuiltinConcepts.CONCEPT_ALREADY_DEFINED)
def test_i_can_disable_an_evaluator():
sheerka = get_sheerka()
concept = Concept(name="one", body="1")
sheerka.add_in_cache(concept)
text = "one"
p = next(e for e in sheerka.evaluators if e.__name__ == "PythonEvaluator")
p.enabled = False # not that you disable the class, not the instance
res = sheerka.evaluate_user_input(text)
assert len(res) == 1
assert res[0].status
assert sheerka.isinstance(res[0].value, BuiltinConcepts.PARSER_RESULT)
p.enabled = True # put back for the remaining unit tests
# def test_i_can_disable_an_evaluator():
# sheerka = get_sheerka()
# concept = Concept(name="one", body="1")
# sheerka.add_in_cache(concept)
#
# text = "one"
# p = next(e for e in sheerka.evaluators if e.__name__ == "PythonEvaluator")
# p.enabled = False # not that you disable the class, not the instance
#
# res = sheerka.evaluate_user_input(text)
# assert len(res) == 1
# assert res[0].status
# assert sheerka.isinstance(res[0].value, BuiltinConcepts.PARSER_RESULT)
#
# p.enabled = True # put back for the remaining unit tests
@pytest.mark.parametrize("text", [