Exemple #1
0
 def test_rss_get(self):
     for file in TEST_FILE_LIST:
         file = "%s/%s" % (TEST_DATA_DIR, file) 
         r = RSSReader(file)
         self.assertEqual(len(r.feed["entries"]), r.get_num_entries())
         self.assertEqual(r.url, file)
         d = r.get_entries()
         for entry in r.feed["entries"]:
             rawKey = entry["title"]
             self.assertTrue(d.has_key(rawKey))
             self.assertTrue(entry["link"] in d[rawKey])
         self.assertTrue(r.has_entries())
         r.feed["entries"] = {}
         self.assertFalse(r.has_entries())
         del r.feed["entries"]
         self.assertFalse(r.has_entries())
Exemple #2
0
 def test_num_entries(self):
     for file in TEST_FILE_LIST:
         f = "%s/%s" % (TEST_DATA_DIR, file)
         r = RSSReader(f)
         self.assertEqual(NUM_ENTRIES[file], r.get_num_entries())