29 lines
913 B
Python
29 lines
913 B
Python
import pytest
|
|
|
|
from core.builtin_concepts_ids import BuiltinConcepts
|
|
from evaluators.PythonEvaluator import PythonEvalError
|
|
from tests.TestUsingMemoryBasedSheerka import TestUsingMemoryBasedSheerka
|
|
|
|
|
|
class TestSheerkaNonRegDisplay(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",)
|