

def test_get_video_id():
    data = [('http://pyvideo.org/video/2822', 2822), ('http://pyvideo.org/video/2822/', 2822), ('http://pyvideo.org/video/2822/foo-bar-baz', 2822), ('https://pyvideo.org/video/2822/foo-bar-baz', 2822), ('https://richard.example.com/video/2822/foo-bar-baz', 2822)]
    for (url, expected) in data:
        assert (get_video_id(url) == expected)
    data = [None, 'foo', 'http://pyvideo.org/', 'http://pyvideo.org/video/foo']
    for url in data:
        with pytest.raises(SteveException):
            get_video_id(url)

dataset/ETHPy150Open pyvideo/steve/tests/test_utils.py test_get_video_id/original