test_collections.py 文件源码

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

项目:python-twitch-client 作者: tsifrer 项目源码 文件源码
def test_create():
    channel_id = 'abcd'
    responses.add(responses.POST,
                  '%schannels/%s/collections' % (BASE_URL, channel_id),
                  body=json.dumps(example_collection),
                  status=200,
                  content_type='application/json')

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

    collection = client.collections.create(channel_id, 'this is title')

    assert len(responses.calls) == 1
    assert isinstance(collection, Collection)
    assert collection.id == example_collection['_id']
    assert collection.items_count == example_collection['items_count']
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号