add create onif file and new folder

This commit is contained in:
stubbfel
2014-07-26 00:45:40 +02:00
parent cd2b59dce3
commit d1e64e66de
5 changed files with 78 additions and 7 deletions

View File

@@ -32,6 +32,17 @@ class TestConfig(unittest.TestCase):
self.assertIsNotNone(prefix)
self.assertIsInstance(prefix, dict)
def test_feed_config_file_suffix(self):
suffix = Config.get("ConfigFileSuffix")
self.assertIsNotNone(suffix)
self.assertIsInstance(suffix, str)
def test_feed_config_file_extension(self):
extension = Config.get("ConfigFileExtension")
self.assertIsNotNone(extension)
self.assertIsInstance(extension, str)
self.assertIn(".", extension)
if __name__ == '__main__':
unittest.main()

View File

@@ -2,10 +2,18 @@ __author__ = 'dev'
import unittest
from feed.feed import Feed
from utilities.jsonfile import JsonFile
from config.config import Config
import os.path
class TestFeed(unittest.TestCase):
def setUp(self):
super().setUp()
self.testFeed = Feed("sbk", "podcast", "application/x-bittorrent",
"http://www.staatsbuergerkunde-podcast.de/feed/mp3-rss/")
def test_load_new_feed(self):
self.assertTrue(False)
@@ -28,10 +36,16 @@ class TestFeed(unittest.TestCase):
self.assertTrue(False)
def test_new_feed_folder(self):
self.assertTrue(False)
self.assertTrue(os.path.exists(self.testFeed.new_feed_folder()))
def test_create_feed_config_file(self):
self.assertTrue(False)
feed_config = self.testFeed.create_feed_config_file("sbk", "podcast", "application/x-bittorrent",
"http://www.staatsbuergerkunde-podcast.de/feed/mp3-rss/")
self.assertIsNotNone(feed_config)
self.assertEqual("sbk", feed_config["FeedName"])
self.assertEqual("podcast", feed_config["FeedType"])
self.assertEqual("application/x-bittorrent", feed_config["LinkType"])
self.assertEqual("http://www.staatsbuergerkunde-podcast.de/feed/mp3-rss/", feed_config["FeedUrl"])
if __name__ == '__main__':