__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
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" ])
def test_choice_mode(self): s = FeedParser("src.xml", "output.xml") self.assertEqual(s.choice_mode('s', 1), True)
def test_multi_scrapping(self): s = FeedParser("src.xml", "output.xml") self.assertEqual(s.multi_scrapping(1), False)
def test_write_xml(self): s = FeedParser("src.xml", "output.xml") self.assertEqual( s.write_xml(ET.Element("Data"), "", "", "", "", "", 10), True)
def test_news_compare(self): s = FeedParser("src.xml", "output.xml") self.assertEqual( s.news_compare(" ", [-749573011], "blabla", "", "empty", 0), True)