コード例 #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)
コード例 #2
0
ファイル: test_bot.py プロジェクト: Freiza/program-y
    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)
コード例 #3
0
ファイル: test_brainfactory.py プロジェクト: lilnana00/3ddd
    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)
コード例 #4
0
ファイル: test_bot.py プロジェクト: frdino131/RyanCBT
    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)
コード例 #5
0
ファイル: test_brainfactory.py プロジェクト: lilnana00/3ddd
    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)