class YouTubeOembedTestCase(YouTubeTestCase): def setUp(self): YouTubeTestCase.setUp(self) self.loader = OEmbedLoader(self.url) def test_forbidden(self): expected_data = {'is_embeddable': False} response = self.get_response('', code=requests.codes.forbidden) data = self.loader.get_video_data(response) self.assertDictEqual(data, expected_data) def test_unauthorized(self): expected_data = {'is_embeddable': False} response = self.get_response('', code=requests.codes.unauthorized) data = self.loader.get_video_data(response) self.assertDictEqual(data, expected_data) def test_404(self): response = self.get_response('', code=404) data = self.loader.get_video_data(response) self.assertEqual(data, {})
class YouTubeOembedTestCase(YouTubeTestCase): def setUp(self): YouTubeTestCase.setUp(self) self.loader = OEmbedLoader(self.url) def test_forbidden(self): expected_data = {"is_embeddable": False} response = self.get_response("", code=requests.codes.forbidden) data = self.loader.get_video_data(response) self.assertDictEqual(data, expected_data) def test_unauthorized(self): expected_data = {"is_embeddable": False} response = self.get_response("", code=requests.codes.unauthorized) data = self.loader.get_video_data(response) self.assertDictEqual(data, expected_data) def test_404(self): response = self.get_response("", code=404) data = self.loader.get_video_data(response) self.assertEqual(data, {})
def setUp(self): YouTubeTestCase.setUp(self) self.loader = OEmbedLoader(self.url)