Example #1
0
__author__ = 'andrey_prvt'
from RSSFeedParser import FeedParser
import time


feed_parser = FeedParser("src.xml", "output.xml")

start_time = time.time()
feed_parser.choice_mode('m', 0)
end_time = time.time()

print end_time - start_time
Example #2
0
 def test_get_urls_from_xml(self):
     s = FeedParser("src.xml", "output.xml")
     self.assertEqual(s.get_rss_urls(), [
         "http://feeds.reuters.com/reuters/technologyNews?format=xml",
         "http://feeds.reuters.com/reuters/technologyNews?format=xml"
     ])
Example #3
0
 def test_choice_mode(self):
     s = FeedParser("src.xml", "output.xml")
     self.assertEqual(s.choice_mode('s', 1), True)
Example #4
0
 def test_multi_scrapping(self):
     s = FeedParser("src.xml", "output.xml")
     self.assertEqual(s.multi_scrapping(1), False)
Example #5
0
 def test_write_xml(self):
     s = FeedParser("src.xml", "output.xml")
     self.assertEqual(
         s.write_xml(ET.Element("Data"), "", "", "", "", "", 10), True)
Example #6
0
 def test_news_compare(self):
     s = FeedParser("src.xml", "output.xml")
     self.assertEqual(
         s.news_compare(" ", [-749573011], "blabla", "", "empty", 0), True)