Ejemplo n.º 1
0
 async def test_bttv_broadcaster_priority(self):
     self.data.bttv_get_cached_broadcasters.return_value = {}
     bgtchannel = Mock(spec=Channel)
     bgtchannel.channel = 'botgotsthis'
     bgtchannel.isStreaming = False
     bgtchannel.sessionData = {}
     mgtchannel = Mock(spec=Channel)
     mgtchannel.channel = 'megotsthis'
     mgtchannel.isStreaming = True
     mgtchannel.sessionData = {}
     self.mock_globals.channels = {'botgotsthis': bgtchannel,
                                   'megotsthis': mgtchannel}
     await emotes.refreshBttvRandomBroadcasterEmotes(self.now)
     self.data.bttv_load_broadcaster_emotes.assert_called_once_with(
         'megotsthis', background=True)
Ejemplo n.º 2
0
 async def test_ffz_broadcaster_onlyone(self, mock_choice):
     self.data.ffz_get_cached_broadcasters.return_value = {}
     bgtchannel = Mock(spec=Channel)
     bgtchannel.channel = 'botgotsthis'
     bgtchannel.isStreaming = False
     bgtchannel.sessionData = {}
     mgtchannel = Mock(spec=Channel)
     mgtchannel.channel = 'megotsthis'
     mgtchannel.isStreaming = False
     mgtchannel.sessionData = {}
     self.mock_globals.channels = {'botgotsthis': bgtchannel,
                                   'megotsthis': mgtchannel}
     mock_choice.return_value = bgtchannel
     await emotes.refreshFfzRandomBroadcasterEmotes(self.now)
     self.data.ffz_load_broadcaster_emotes.assert_called_once_with(
         'botgotsthis', background=True)
Ejemplo n.º 3
0
 async def test_ffz_broadcaster(self):
     self.data.ffz_get_cached_broadcasters.return_value = {}
     channel = Mock(spec=Channel)
     channel.channel = 'botgotsthis'
     channel.isStreaming = False
     channel.sessionData = {}
     self.mock_globals.channels = {'botgotsthis': channel}
     await emotes.refreshFfzRandomBroadcasterEmotes(self.now)
     self.data.ffz_load_broadcaster_emotes.assert_called_once_with(
         'botgotsthis', background=True)
Ejemplo n.º 4
0
 async def test_ffz_broadcaster_recent(self):
     self.data.ffz_get_cached_broadcasters.return_value = {
         'botgotsthis': 3600,
     }
     channel = Mock(spec=Channel)
     channel.channel = 'botgotsthis'
     channel.isStreaming = False
     channel.sessionData = {}
     self.mock_globals.channels = {'botgotsthis': channel}
     await emotes.refreshFfzRandomBroadcasterEmotes(self.now)
     self.assertFalse(self.data.ffz_load_broadcaster_emotes.called)