Esempio n. 1
0
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, {})
Esempio n. 2
0
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, {})
Esempio n. 3
0
 def setUp(self):
     YouTubeTestCase.setUp(self)
     self.loader = OEmbedLoader(self.url)
Esempio n. 4
0
 def setUp(self):
     YouTubeTestCase.setUp(self)
     self.loader = OEmbedLoader(self.url)