def test_KnowledgeEngine_reset_resets_facts(): from experta.engine import KnowledgeEngine ke = KnowledgeEngine() ke.facts = None ke.reset() assert ke.facts is not None
def test_KnowledgeEngine_retract_retracts_fact(): from experta.engine import KnowledgeEngine from unittest.mock import patch ke = KnowledgeEngine() with patch('experta.factlist.FactList') as mock: ke.facts = mock ke.retract({'__factid__': (0, )}) assert mock.retract.called
def test_KnowledgeEngine_declare_define_fact(): from experta.engine import KnowledgeEngine from experta import Fact from unittest.mock import patch ke = KnowledgeEngine() with patch('experta.factlist.FactList') as mock: ke.facts = mock ke.declare(Fact()) assert mock.declare.called