Exemplo n.º 1
0
    def assert_talk_details(self, talk_url, expected_video_url, expected_title, expected_speaker, expect_plot, expect_json):
        video_url, title, speaker, plot, talk_json = talk_scraper.get(test_util.get_HTML(talk_url))
        self.assertEqual(expected_video_url, video_url)
        self.assertEqual(expected_title, title)
        self.assertEqual(expected_speaker, speaker)

        if (expect_plot):
            self.assertTrue(plot)  # Not None or empty
        else:
            self.assertIsNone(plot)

        if expect_json:
            self.assertTrue(talk_json)  # Not None or empty
        else:
            self.assertIsNone(talk_json)
Exemplo n.º 2
0
    def assert_talk_details(self, talk_url, expected_video_url, expected_title, expected_speaker, expect_plot, expect_json):
        video_url, title, speaker, plot, talk_json = talk_scraper.get(test_util.get_HTML(talk_url))
        self.assertEqual(expected_video_url, video_url)
        self.assertEqual(expected_title, title)
        self.assertEqual(expected_speaker, speaker)

        if (expect_plot):
            self.assertTrue(plot)  # Not None or empty
        else:
            self.assertIsNone(plot)

        if expect_json:
            self.assertTrue(talk_json)  # Not None or empty
        else:
            self.assertIsNone(talk_json)
Exemplo n.º 3
0
 def test():
     talk_scraper.get(html);
Exemplo n.º 4
0
 def assert_custom_quality_url(self, talk_html, video_quality, expected_video_url):
     video_url, title, speaker, plot, talk_json = talk_scraper.get(talk_html, video_quality)
     self.assertEqual(expected_video_url, video_url)
 def __get_talk_json__(self, url):
     html = urllib.urlopen(url).read()
     foo, fi, fo, fum, talk_json = talk_scraper.get(html)
     return talk_json
Exemplo n.º 6
0
 def test():
     talk_scraper.get(html)
Exemplo n.º 7
0
 def assert_custom_quality_url(self, talk_html, video_quality,
                               expected_video_url):
     video_url, title, speaker, plot, talk_json = talk_scraper.get(
         talk_html, video_quality)
     self.assertEqual(expected_video_url, video_url)
Exemplo n.º 8
0
 def __get_talk_json__(self, url):
     html = urllib.urlopen(url).read()
     foo, fi, fo, fum, talk_json = talk_scraper.get(html)
     return talk_json