e41094f908
Fixed #12 Fixed #13 Fixed #14
24 lines
906 B
Python
24 lines
906 B
Python
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
|