Beispiel #1
0
    def test_format_message_with_bot(self):
        config = BotConfiguration()
        config._section_name = "testbot"
        bot = Bot(config)

        msg = YLogger.format_message(bot, "Test Message")
        self.assertIsNotNone(msg)
        self.assertEquals("[] [testbot] - Test Message", msg)
Beispiel #2
0
    def test_format_message_with_bot(self):
        config = BotConfiguration()
        config._section_name = "testbot"
        bot = Bot(config)

        msg = YLogger.format_message(bot, "Test Message")
        self.assertIsNotNone(msg)
        self.assertEquals("[] [testbot] - Test Message", msg)
Beispiel #3
0
    def test_format_message_with_client_and_bot_and_brain(self):
        brain_config = BrainConfiguration()
        brain_config._section_name = "testbrain"
        brain = Brain(None, brain_config)

        msg = YLogger.format_message(brain, "Test Message")
        self.assertIsNotNone(msg)
        self.assertEquals("[] [] [testbrain] - Test Message", msg)
Beispiel #4
0
    def test_format_message_with_client_and_bot_and_brain(self):
        brain_config = BrainConfiguration()
        brain_config._section_name = "testbrain"
        brain = Brain(None, brain_config)

        msg = YLogger.format_message(brain, "Test Message")
        self.assertIsNotNone(msg)
        self.assertEquals("[] [] [testbrain] - Test Message", msg)
    def test_format_message_with_bot(self):
        config = BotConfiguration()
        config._section_name = "testbot"
        client = TestClient()
        bot = Bot(config, client)

        msg = YLogger.format_message(bot, "Test Message")
        self.assertIsNotNone(msg)
        self.assertEqual("[testclient] [testbot] - Test Message", msg)
    def test_format_message_with_client_and_default_bot_and_brain(self):
        brain_config = BrainConfiguration()
        client = TestClient()
        context = client.create_client_context("testid")

        brain_config._section_name = "testbrain"
        brain = Brain(context.bot, brain_config)

        msg = YLogger.format_message(brain, "Test Message")
        self.assertIsNotNone(msg)
        self.assertEqual("[testclient] [bot] [testbrain] - Test Message", msg)
Beispiel #7
0
    def test_format_message_with_client_and_bot_and_brain(self):
        client = TestClient()

        bot_config = BotConfiguration()
        bot_config._section_name = "testbot"
        bot = Bot(bot_config, client)

        brain_config = BrainConfiguration()
        brain_config._section_name = "testbrain"
        brain = Brain(bot, brain_config)

        msg = YLogger.format_message(brain, "Test Message")
        self.assertIsNotNone(msg)
        self.assertEquals("[testclient] [testbot] [testbrain] - Test Message", msg)
Beispiel #8
0
    def test_format_message_with_client_and_bot_and_brain(self):
        client = TestClient()

        bot_config = BotConfiguration()
        bot_config._section_name = "testbot"
        bot = Bot(bot_config, client)

        brain_config = BrainConfiguration()
        brain_config._section_name = "testbrain"
        brain = Brain(bot, brain_config)

        msg = YLogger.format_message(brain, "Test Message")
        self.assertIsNotNone(msg)
        self.assertEquals("[testclient] [testbot] [testbrain] - Test Message", msg)
    def test_format_message_with_client_context(self):
        client = TestClient()

        bot_config = BotConfiguration()
        bot_config._section_name = "testbot"
        bot = Bot(bot_config, client)

        brain_config = BrainConfiguration()
        brain_config._section_name = "testbrain"
        brain = Brain(bot, brain_config)

        client_context = ClientContext(client, "testuser")
        client_context._bot = bot
        client_context._brain = brain

        msg = YLogger.format_message(client_context, "Test Message")
        self.assertIsNotNone(msg)
        self.assertEqual("[testclient] [testbot] [testbrain] [testuser] - Test Message", msg)
Beispiel #10
0
    def test_format_message_with_client_context(self):

        client = TestClient()

        bot_config = BotConfiguration()
        bot_config._section_name = "testbot"
        bot = Bot(bot_config, client)

        brain_config = BrainConfiguration()
        brain_config._section_name = "testbrain"
        brain = Brain(bot, brain_config)

        client_context = ClientContext(client, "testuser")
        client_context._bot = bot
        client_context._brain = brain

        msg = YLogger.format_message(client_context, "Test Message")
        self.assertIsNotNone(msg)
        self.assertEquals("[testclient] [testbot] [testbrain] [testuser] - Test Message", msg)
Beispiel #11
0
    def test_format_message_with_client(self):
        client = TestClient()

        msg = YLogger.format_message(client, "Test Message")
        self.assertIsNotNone(msg)
        self.assertEquals("[testclient] - Test Message", msg)
Beispiel #12
0
    def test_format_message_with_client(self):
        client = TestClient()

        msg = YLogger.format_message(client, "Test Message")
        self.assertIsNotNone(msg)
        self.assertEquals("[testclient] - Test Message", msg)