def tests_conversation_storage(self): config = LoggerStorageConfiguration() engine = LoggerStorageEngine(config) engine.initialise() store = LoggerConversationStore(engine) self.assertEqual(store.storage_engine, engine) self.assert_conversation_storage(store, can_empty=False, test_load=False)
def test_store_conversation(self): config = LoggerStorageConfiguration() engine = LoggerStorageEngine(config) engine.initialise() store = LoggerConversationStore(engine) client = TestClient() client_context = client.create_client_context("user1") conversation = Conversation(client_context) question1 = Question.create_from_text(client_context, "Hello There") question1.sentence(0).response = "Hi" conversation.record_dialog(question1) store.store_conversation(client_context, conversation)
def create_engine(self): engine = LoggerStorageEngine(self) engine.initialise() return engine
def test_initialise(self): config = LoggerStorageConfiguration() engine = LoggerStorageEngine(config) engine.initialise() store = LoggerConversationStore(engine) self.assertEqual(store.storage_engine, engine)
def test_conversations(self): config = LoggerStorageConfiguration() engine = LoggerStorageEngine(config) engine.initialise() self.conversation_asserts(storage_engine=engine, visit=False)
def test_init_with_configuration(self): config = unittest.mock.Mock engine = LoggerStorageEngine(config) self.assertIsNotNone(engine) self.assertIsNotNone(engine.configuration)