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)
Esempio n. 2
0
    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)
Esempio n. 3
0
 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)
Esempio n. 5
0
 def test_conversations(self):
     config = LoggerStorageConfiguration()
     engine = LoggerStorageEngine(config)
     engine.initialise()
     self.conversation_asserts(storage_engine=engine, visit=False)