File size: 509 Bytes
f7e59f8 e707f93 f7e59f8 e707f93 f7e59f8 25de36d e7518ec 82321d6 e707f93 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# -*- coding: utf-8 -*-
from pytube.exceptions import VideoUnavailable, RegexMatchError
def test_video_unavailable():
try:
raise VideoUnavailable(video_id="YLnZklYFe7E")
except VideoUnavailable as e:
assert e.video_id == "YLnZklYFe7E"
assert str(e) == "YLnZklYFe7E is unavailable"
def test_regex_match_error():
try:
raise RegexMatchError(caller="hello", pattern="*")
except RegexMatchError as e:
assert str(e) == "hello: could not find match for *"
|