Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /plugin.video.ted.talks/resources/lib/ted_talks_scraper_test.py [222679] .. [bfc790] Maximize Restore

  Switch to side-by-side view

--- a/plugin.video.ted.talks/resources/lib/ted_talks_scraper_test.py
+++ b/plugin.video.ted.talks/resources/lib/ted_talks_scraper_test.py
@@ -36,18 +36,15 @@
         self.ted_talks.getVideoDetails("http://www.ted.com/talks/bjarke_ingels_hedonistic_sustainability.html")
 
 
-class TestNewTalks(unittest.TestCase):
+class TestSpeakers(unittest.TestCase):
+    
+    def setUp(self):
+        self.speakers = ted_talks_scraper.Speakers(getHTML, None)
+    
+    def test_smoke(self):
+        speakers = list(self.speakers.getAllSpeakers())
+        # 1027 at time of writing, feel free to update
+        self.assertTrue(len(speakers) >= 1027)
+        # See https://github.com/moreginger/xbmc-plugin.video.ted.talks/issues/14 for the chosen speaker :)
+        self.assertTrue('Clifford Stoll' in [s['Title'] for s in speakers])
 
-    def setUp(self):
-        self.new_talks = ted_talks_scraper.NewTalks(getHTML, lambda code: "%s" % code)
-
-    def test_smoke(self):
-        new_talks_page_1 = list(self.new_talks.getNewTalks())
-        self.assertEqual((True, {'Title':'30020', 'mode':'newTalks', 'url':u'http://www.ted.com/talks/list?page=2'}), new_talks_page_1[0])
-        assertTalk(self, new_talks_page_1[1])
-        
-        new_talks_page_2 = list(self.new_talks.getNewTalks(new_talks_page_1[0][1]['url']))
-        self.assertEqual((True, {'Title':'30020', 'mode':'newTalks', 'url':u'http://www.ted.com/talks/list?page=3'}), new_talks_page_2[0])
-        self.assertEqual((True, {'Title':'30021', 'mode':'newTalks', 'url':u'http://www.ted.com/talks/list?page=1'}), new_talks_page_2[1])
-        assertTalk(self, new_talks_page_2[2])
-