コード例 #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)
コード例 #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)
コード例 #3
0
 def test():
     talk_scraper.get(html);
コード例 #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)
コード例 #5
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
コード例 #6
0
 def test():
     talk_scraper.get(html)
コード例 #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)
コード例 #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