1059ce25c5
Fixed #70: SheerkaFilterManager : Pipe functions Fixed #71: SheerkaFilterManager : filter_objects Fixed #75: SheerkaMemory: Enhance memory() to use the filtering capabilities Fixed #76: SheerkaEvaluateConcept: Concepts that modify the state of the system must not be evaluated during question
29 lines
911 B
Python
29 lines
911 B
Python
import pytest
|
|
|
|
from core.builtin_concepts_ids import BuiltinConcepts
|
|
from evaluators.PythonEvaluator import PythonEvalError
|
|
from tests.TestUsingMemoryBasedSheerka import TestUsingMemoryBasedSheerka
|
|
|
|
|
|
class TestSheerkaNonRegRules(TestUsingMemoryBasedSheerka):
|
|
|
|
@pytest.mark.skip
|
|
def test_i_can_apply_simple_rule(self):
|
|
init = [
|
|
"def concept one as 1",
|
|
"when __ret.status then test_error()",
|
|
]
|
|
|
|
sheerka = self.init_scenario(init)
|
|
sheerka.enable_process_rules = True
|
|
res = sheerka.evaluate_user_input("one")
|
|
|
|
assert len(res) == 1
|
|
ret = res[0]
|
|
|
|
assert not ret.status
|
|
assert sheerka.isinstance(ret.body, BuiltinConcepts.ERROR)
|
|
assert isinstance(ret.body.body, PythonEvalError)
|
|
assert isinstance(ret.body.body.error, Exception)
|
|
assert ret.body.body.error.args == ("I can raise an error",)
|