Пример #1
0
 def test_check_valid_url_mistake_some_chars(self):
     grabber = YTGrabber()
     with pytest.raises(ValueError) as exc_info:
         grabber._check_valid_url(
             'https://www.outube.com/chanel/UCMXHtrkazQjeCOteE4sof8g/playlists'
         )
     assert exc_info.type is ValueError
Пример #2
0
 def test_check_valid_url_not_corect_protocol(self):
     grabber = YTGrabber()
     with pytest.raises(ValueError) as exc_info:
         grabber._check_valid_url(
             'http://www.youtube.com/channel/UCMXHtrkazQjeCOteE4sof8g/playlists'
         )
     assert exc_info.type is ValueError
Пример #3
0
 def test_check_valid_url_empty_string(self):
     grabber = YTGrabber()
     with pytest.raises(ValueError) as exc_info:
         grabber._check_valid_url(' ')
     assert exc_info.type is ValueError
Пример #4
0
 def test_check_valid_url_random_chars(self):
     grabber = YTGrabber()
     with pytest.raises(ValueError) as exc_info:
         grabber._check_valid_url('sdfsdf')
     assert exc_info.type is ValueError
Пример #5
0
 def test_check_valid_url_int(self):
     grabber = YTGrabber()
     with pytest.raises(TypeError) as exc_info:
         grabber._check_valid_url(123123)
     assert exc_info.type is TypeError