Finish feedconfigfile
This commit is contained in:
1
src/config/__init__.py
Normal file
1
src/config/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
__author__ = 'dev'
|
||||
8
src/config/config.py
Normal file
8
src/config/config.py
Normal file
@@ -0,0 +1,8 @@
|
||||
__author__ = 'dev'
|
||||
|
||||
Config = {
|
||||
"FeedLinkTypes" : {"application/x-bittorrent","mp3"},
|
||||
"FeedTypes" : {"podcast","rss"},
|
||||
"FeedStorageFolder" : "testfeeds",
|
||||
"FeedStoragePrefix" : { "0" : "FeedTypes"}
|
||||
}
|
||||
1
src/feed/__init__.py
Normal file
1
src/feed/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
__author__ = 'dev'
|
||||
6
src/feed/feed.py
Normal file
6
src/feed/feed.py
Normal file
@@ -0,0 +1,6 @@
|
||||
__author__ = 'dev'
|
||||
|
||||
class Feed:
|
||||
|
||||
def __init__(self):
|
||||
self.valid_file_types = {"application/x-bittorrent","mp3"}
|
||||
4
testenv/testfeeds/podcast/sbk-config.json
Normal file
4
testenv/testfeeds/podcast/sbk-config.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"FeedUrl" : "http://www.staatsbuergerkunde-podcast.de/feed/mp3-rss/"
|
||||
"LinkType" : "application/x-bittorrent"
|
||||
}
|
||||
1
testenv/tests/config/__init__.py
Normal file
1
testenv/tests/config/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
__author__ = 'dev'
|
||||
37
testenv/tests/config/testconfig.py
Normal file
37
testenv/tests/config/testconfig.py
Normal file
@@ -0,0 +1,37 @@
|
||||
__author__ = 'dev'
|
||||
|
||||
import unittest
|
||||
import os.path
|
||||
from config.config import Config
|
||||
|
||||
|
||||
class TestConfig(unittest.TestCase):
|
||||
|
||||
def test_key_not_exists(self):
|
||||
value = Config.get("not_existing_config_key")
|
||||
self.assertIsNone(value)
|
||||
|
||||
def test_feed_types(self):
|
||||
types = Config.get("FeedTypes")
|
||||
self.assertIsNotNone(types)
|
||||
self.assertIsInstance(types, set)
|
||||
|
||||
def test_feed_link_types(self):
|
||||
types = Config.get("FeedLinkTypes")
|
||||
self.assertIsNotNone(types)
|
||||
self.assertIsInstance(types, set)
|
||||
|
||||
def test_feed_storage_folder(self):
|
||||
path = Config.get("FeedStorageFolder")
|
||||
self.assertIsNotNone(path)
|
||||
self.assertIsInstance(path, str)
|
||||
self.assertTrue(os.path.isdir(path))
|
||||
|
||||
def test_feed_storage_prefix(self):
|
||||
prefix = Config.get("FeedStoragePrefix")
|
||||
self.assertIsNotNone(prefix)
|
||||
self.assertIsInstance(prefix, dict)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
1
testenv/tests/feed/__init__.py
Normal file
1
testenv/tests/feed/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
__author__ = 'dev'
|
||||
24
testenv/tests/feed/testfeed.py
Normal file
24
testenv/tests/feed/testfeed.py
Normal file
@@ -0,0 +1,24 @@
|
||||
__author__ = 'dev'
|
||||
|
||||
import unittest
|
||||
from feed.feed import Feed
|
||||
|
||||
|
||||
class TestFeed(unittest.TestCase):
|
||||
|
||||
def test_load_new_feed(self, url):
|
||||
self.assertTrue(False)
|
||||
|
||||
def test_load_existing_feed(self, path):
|
||||
self.assertTrue(False)
|
||||
|
||||
def test_load_feed(self, path):
|
||||
self.assertTrue(False)
|
||||
|
||||
def test_setup_feed(self, name, url, feed_type):
|
||||
self.assertTrue(False)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user