test_channels.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:python-twitch-client 作者: tsifrer 项目源码 文件源码
def test_get_videos():
    channel_id = example_channel['_id']
    response = {
        'videos': [example_video]
    }
    responses.add(responses.GET,
                  '%schannels/%s/videos' % (BASE_URL, channel_id),
                  body=json.dumps(response),
                  status=200,
                  content_type='application/json')

    client = TwitchClient('client id', 'oauth token')

    videos = client.channels.get_videos(channel_id)

    assert len(responses.calls) == 1
    assert len(videos) == 1
    assert isinstance(videos[0], Video)
    video = videos[0]
    assert isinstance(video, Video)
    assert video.id == example_video['_id']
    assert video.description == example_video['description']
    assert video.fps['1080p'] == example_video['fps']['1080p']
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号