39 lines
1.2 KiB
Python
Executable File
39 lines
1.2 KiB
Python
Executable File
__author__ = 'dev'
|
|
|
|
import unittest
|
|
from feed.feed import Feed
|
|
from feed.torrent_daemon_entry_handler import TorrentDaemonEntryHandler
|
|
|
|
class TestTorrentDaemonEntryHandler(unittest.TestCase):
|
|
|
|
def setUp(self):
|
|
self.__feed = Feed("sbk", "podcast", "application/x-bittorrent", "testfeeds/podcast/sbk/sbk.xml")
|
|
self.__test_torrent = "http://bitlove.org/nitramred/staatsbuergerkunde-mp3/SBK028_Arbeit.mp3.torrent"
|
|
self.__tdeh = TorrentDaemonEntryHandler(self.__feed)
|
|
self.__tdeh.start_daemon()
|
|
|
|
def tearDown(self):
|
|
self.__tdeh.stop_daemon()
|
|
|
|
def test_start_daemon(self):
|
|
self.assertTrue(self.__tdeh.is_running_daemon())
|
|
|
|
def test_stop_daemon(self):
|
|
self.__tdeh.stop_daemon()
|
|
self.assertFalse(self.__tdeh.is_running_daemon())
|
|
|
|
def test_is_running_daemon(self):
|
|
self.assertTrue(self.__tdeh.is_running_daemon())
|
|
self.__tdeh.stop_daemon()
|
|
self.assertFalse(self.__tdeh.is_running_daemon())
|
|
|
|
def test_start_torrent(self):
|
|
self.assertTrue(False)
|
|
|
|
def test_add_torrent_to_daemon(self):
|
|
self.__tdeh.add_torrent_to_daemon(self.__test_torrent)
|
|
self.assertTrue(True)
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|