Esempio n. 1
0
    def setUp(self):
        channel_save_patcher = patch(
            'twitch.channel_manager.ChannelManager.save_channel_data')
        channel_load_patcher = patch(
            'twitch.channel_manager.ChannelManager.load_channel_data')
        for patcher in [channel_save_patcher, channel_load_patcher]:
            patcher.start()
            self.addCleanup(patcher.stop)

        bot = MagicMock()
        self.channel_manager = ChannelManager(bot)
Esempio n. 2
0
    def setUp(self):
        channel_save_patcher = patch('twitch.channel_manager.ChannelManager.save_channel_data')
        channel_load_patcher = patch('twitch.channel_manager.ChannelManager.load_channel_data')
        for patcher in [channel_save_patcher, channel_load_patcher]:
            patcher.start()
            self.addCleanup(patcher.stop)

        bot = MagicMock()
        self.channel_manager = ChannelManager(bot)
Esempio n. 3
0
class TestChannelManager(unittest.TestCase):
    def setUp(self):
        channel_save_patcher = patch('twitch.channel_manager.ChannelManager.save_channel_data')
        channel_load_patcher = patch('twitch.channel_manager.ChannelManager.load_channel_data')
        for patcher in [channel_save_patcher, channel_load_patcher]:
            patcher.start()
            self.addCleanup(patcher.stop)

        bot = MagicMock()
        self.channel_manager = ChannelManager(bot)

    def test_chatters(self):
        # Requires internet!
        chatters = self.channel_manager.get_chatters('Xelaadryth')
        self.channel_manager.get_moderators('Xelaadryth')
        self.channel_manager.get_viewers('Xelaadryth')
        self.assertIn('chatters', chatters, 'Chatters not in chatters response.')
        self.assertIn('moderators', chatters['chatters'], 'Moderators not in chatters response.')
        self.assertIn('viewers', chatters['chatters'], 'Moderators not in chatters response.')
Esempio n. 4
0
class TestChannelManager(unittest.TestCase):
    def setUp(self):
        channel_save_patcher = patch(
            'twitch.channel_manager.ChannelManager.save_channel_data')
        channel_load_patcher = patch(
            'twitch.channel_manager.ChannelManager.load_channel_data')
        for patcher in [channel_save_patcher, channel_load_patcher]:
            patcher.start()
            self.addCleanup(patcher.stop)

        bot = MagicMock()
        self.channel_manager = ChannelManager(bot)

    def test_chatters(self):
        # Requires internet!
        chatters = self.channel_manager.get_chatters('Xelaadryth')
        self.channel_manager.get_moderators('Xelaadryth')
        self.channel_manager.get_viewers('Xelaadryth')
        self.assertIn('chatters', chatters,
                      'Chatters not in chatters response.')
        self.assertIn('moderators', chatters['chatters'],
                      'Moderators not in chatters response.')
        self.assertIn('viewers', chatters['chatters'],
                      'Moderators not in chatters response.')