예제 #1
0
    def test_get_user_global_unknown(self):

        client = PropertiesAdminExtensionClient()
        client_context = client.create_client_context("testid")

        extension = PropertiesAdminExtension()
        self.assertIsNotNone(extension)

        result = extension.execute(client_context, "GET USER GLOBAL XXX")
        self.assertIsNotNone(result)
        self.assertEquals("unknown", result)
예제 #2
0
    def test_get_bot_known(self):

        client = PropertiesAdminExtensionClient()
        client_context = client.create_client_context("testid")

        client_context.brain.properties.add_property("PROP1", "Value1")

        extension = PropertiesAdminExtension()
        self.assertIsNotNone(extension)

        result = extension.execute(client_context, "GET BOT PROP1")
        self.assertIsNotNone(result)
        self.assertEquals("Value1", result)
예제 #3
0
    def test_get_user_global_known(self):

        client = PropertiesAdminExtensionClient()
        client_context = client.create_client_context("testid")

        client_context.bot.get_conversation(client_context).set_property("PROP1", "Value1")

        extension = PropertiesAdminExtension()
        self.assertIsNotNone(extension)

        result = extension.execute(client_context, "GET USER GLOBAL PROP1")
        self.assertIsNotNone(result)
        self.assertEquals("Value1", result)
예제 #4
0
    def test_get_user(self):

        client = PropertiesAdminExtensionClient()
        client_context = client.create_client_context("testid")

        extension = PropertiesAdminExtension()
        self.assertIsNotNone(extension)

        client_context.bot.get_conversation(client_context)

        result = extension.execute(client_context, "USER")
        self.assertIsNotNone(result)
        self.assertEquals("Properties:<br /><ul><li>topic = *</li></ul><br />", result)