Exemple #1
0
def test_save_expression():
    knowledgebase.clear()
    oliveask.eval('A.')
    oliveask.eval('A or B.')
    assert [str(x) for x in knowledgebase.get_all()] == ["A", "(A | B)"]
Exemple #2
0
def test_question_eval():
    knowledgebase.clear()
    oliveask.eval('A.')
    assert grammar.program.parse('A?')[0].eval() == True
    assert grammar.program.parse('B?')[0].eval() == False