def test_get_live_channels(self):
        # This is a tricky one, not sure how to properly test it..
        test_channel_count = 10
        live_channels = self.twitch.get_live_channels()
        error_count = 0
        test_count = 0
        for ch in live_channels:
            ret_json = requests.get(self.TWITCH_REST+'/streams/'+ch).json()
            try:
                ok_(ret_json['stream']['channel']['display_name'] == ch)
            except __HOLE__:
                error_count += 1
            test_count += 1
            if test_count >= test_channel_count:
                break
        # there is time difference between get live and check live
        # it is possible that channel went offline between these 2 api calls
        # so we just expect 80% of tested channels are really live on the
        # 2nd api call
        ok_((float(error_count) / test_count) < 0.20, 'test:{}, error:{}'.format(test_count, error_count))
dataset/ETHPy150Open KavenC/Linot/tests/services/test_twitch_notifier.py/TestTwitchEngine.test_get_live_channels