コード例 #1
0
def test_no_data(patch_get_json):
    from plugins import vimeo

    patch_get_json.return_value = []

    result = vimeo.vimeo_url(vimeo.url_re.search("https://vimeo.com/1125483"))

    assert result is None
コード例 #2
0
def test_no_likes(patch_get_json):
    from plugins import vimeo

    patch_get_json.return_value = deepcopy(DATA)

    result = vimeo.vimeo_url(vimeo.url_re.search("https://vimeo.com/11235"))

    expected_parts = [
        '\x02A video title\x02',
        'length \x0244 seconds\x02',
        '\x020\x02 likes',
        '\x02106\x02 plays',
        '\x02AUser\x02 on \x022006-10-24 22:56:45\x02',
    ]

    expected = ' - '.join(expected_parts)

    assert result == expected