Mercurial > hg > Feedworm
view tests/FeedUpdaterTests.py @ 50:4b0d686493fb
better error handling while adding feeds: data is only saved if a feed could be created and entries could be retrieved. MainWindow displays feedback in the status bar if an exception occurred while adding a feed.
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Mon, 17 May 2010 04:30:55 +0200 |
parents | fd4c8bfa62d6 |
children | bb3c851b18b1 |
line wrap: on
line source
import unittest from Feed import Feed from FeedUpdater import FeedUpdater from FeedUpdater import FeedUpdateException class FeedUpdaterTests(unittest.TestCase): def testFeedContainsInvalidUrl(self): feed = Feed("invalid", "http://thisurldoesnotexist.xxx") try: FeedUpdater(None, feed).update() self.fail("updating an invalid URL must fail") except FeedUpdateException: # this one was expected pass def testFeedContainsValidUrl(self): feed = Feed("valid", "http://www.joelonsoftware.com/rss.xml") result = FeedUpdater(None, feed).getFeed() self.assertEqual("Joel on Software", result["feed"].title) if __name__ == "__main__": #import sys;sys.argv = ['', 'Test.testName'] unittest.main()