Ejemplo n.º 1
0
    def test_load_brain_selector(self):
        configuration = BotConfiguration()
        configuration._brain_selector = "programy.bot.DefaultBrainSelector"

        client = TestClient()
        bot = Bot(configuration, client)

        factory = BrainFactory(bot)
        self.assertIsNotNone(factory)

        factory.load_brain_selector(configuration)
        self.assertIsInstance(factory._brain_selector, DefaultBrainSelector)
Ejemplo n.º 2
0
    def test_empty_config_init(self):
        configuration = BotConfiguration()
        configuration._bot_selector = "programy.clients.client.DefaultBrainSelector"

        bot = Bot(configuration)

        factory = BrainFactory(bot)
        self.assertIsNotNone(factory)

        brain = factory.select_brain()
        self.assertIsNotNone(brain)
        self.assertIsInstance(brain, Brain)
Ejemplo n.º 3
0
    def test_empty_config_init(self):
        configuration = BotConfiguration()

        client = TestClient()
        bot = Bot(configuration, client)

        factory = BrainFactory(bot)
        self.assertIsNotNone(factory)

        brain = factory.select_brain()
        self.assertIsNotNone(brain)
        self.assertIsInstance(brain, Brain)
Ejemplo n.º 4
0
    def test_empty_config_init(self):
        configuration = BotConfiguration()
        configuration._bot_selector = "programy.clients.client.DefaultBrainSelector"

        bot = Bot(configuration)

        factory = BrainFactory(bot)
        self.assertIsNotNone(factory)

        brain = factory.select_brain()
        self.assertIsNotNone(brain)
        self.assertIsInstance(brain, Brain)
Ejemplo n.º 5
0
    def test_invalid_config_init(self):
        configuration = BotConfiguration()
        configuration._brain_selector = "programy.clients.client.DefaultBrainSelectorXXX"

        client = TestClient()
        bot = Bot(configuration, client)

        factory = BrainFactory(bot)
        self.assertIsNotNone(factory)

        brain = factory.select_brain()
        self.assertIsNotNone(brain)
        self.assertIsInstance(brain, Brain)