add assert

This commit is contained in:
stubbfel
2014-07-30 23:02:34 +02:00
parent 67e74675ed
commit 886953c9fc
2 changed files with 4 additions and 1 deletions

View File

@@ -61,6 +61,7 @@ class Feed:
assert feed_type is not None
assert link_type is not None
assert feed_url is not None
assert link_type in Config["FeedLinkTypes"]
feed_config = \
{
"FeedName": feed_name,

View File

@@ -76,7 +76,7 @@ class TestFeed(unittest.TestCase):
self.assertEqual("audio/mpeg", feed_config["LinkType"])
self.assertEqual("http://www.staatsbuergerkunde-podcast.de/feed/mp3-rss/", feed_config["FeedUrl"])
def test_create_feed_config_file_error_none_parameter(self):
def test_create_feed_config_file_error_wrong_parameter(self):
self.assertRaises(AssertionError, self.testFeed.create_feed_config_file, None, "podcast",
"audio/mpeg", "http://www.staatsbuergerkunde-podcast.de/feed/mp3-rss/")
self.assertRaises(AssertionError, self.testFeed.create_feed_config_file, "sbk", None,
@@ -85,6 +85,8 @@ class TestFeed(unittest.TestCase):
"http://www.staatsbuergerkunde-podcast.de/feed/mp3-rss/")
self.assertRaises(AssertionError, self.testFeed.create_feed_config_file, "sbk", "podcast",
"audio/mpeg", None)
self.assertRaises(AssertionError, self.testFeed.create_feed_config_file, "sbk", "podcast",
"audiomg", None)
if __name__ == '__main__':
unittest.main()