import pytest from base import BaseTest from core.BuiltinConcepts import BuiltinConcepts from evaluators.CreateParserInput import CreateParserInput from helpers import _rv, _rvf class TestCreateParserInput(BaseTest): @pytest.fixture() def evaluator(self, sheerka): return sheerka.evaluators[CreateParserInput.NAME] def test_i_can_match(self, sheerka, context, evaluator): ret_val = _rv(sheerka.newn(BuiltinConcepts.USER_INPUT, command="hello sheerka")) assert evaluator.matches(context, ret_val).status is True ret_val = _rv(sheerka.newn(BuiltinConcepts.UNKNOWN_CONCEPT)) # it responds to USER_INPUT only assert evaluator.matches(context, ret_val).status is False ret_val = _rvf(sheerka.newn(BuiltinConcepts.USER_INPUT, command="hello sheerka")) # status should be true assert evaluator.matches(context, ret_val).status is False