import pytest from base import BaseTest, DummyObj from caching.FastCache import FastCache from common.global_symbols import NotFound from core.Event import Event from core.ExecutionContext import ContextActions, ExecutionContext from services.SheerkaMemory import SheerkaMemory class TestSheerkaEngine(BaseTest): @pytest.fixture() def service(self, sheerka): return sheerka.services[SheerkaMemory.NAME] def test_i_can_add_to_global_short_term_memory(self, service): dummy = DummyObj() service.add_to_short_term_memory("a", dummy) assert service.get_from_short_term_memory("a") == dummy assert service.sheerka.om.current_ontology().fast_cache.copy() == {'a': dummy}