CC-5990, CC-5991 - Python cleanup, removed need for /usr/lib/airtime
This commit is contained in:
parent
cd102b984b
commit
875a9dfd8b
115 changed files with 248 additions and 212 deletions
41
python_apps/media-monitor/mm2/tests/test_manager.py
Normal file
41
python_apps/media-monitor/mm2/tests/test_manager.py
Normal file
|
@ -0,0 +1,41 @@
|
|||
import unittest
|
||||
from media.monitor.manager import Manager
|
||||
|
||||
def add_paths(m,paths):
|
||||
for path in paths:
|
||||
m.add_watch_directory(path)
|
||||
|
||||
class TestManager(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.opath = "/home/rudi/Airtime/python_apps/media-monitor2/tests/"
|
||||
self.ppath = "/home/rudi/Airtime/python_apps/media-monitor2/media/"
|
||||
self.paths = [self.opath, self.ppath]
|
||||
|
||||
def test_init(self):
|
||||
man = Manager()
|
||||
self.assertTrue( len(man.watched_directories) == 0 )
|
||||
self.assertTrue( man.watch_channel is not None )
|
||||
self.assertTrue( man.organize_channel is not None )
|
||||
|
||||
def test_organize_path(self):
|
||||
man = Manager()
|
||||
man.set_organize_path( self.opath )
|
||||
self.assertEqual( man.get_organize_path(), self.opath )
|
||||
man.set_organize_path( self.ppath )
|
||||
self.assertEqual( man.get_organize_path(), self.ppath )
|
||||
|
||||
def test_add_watch_directory(self):
|
||||
man = Manager()
|
||||
add_paths(man, self.paths)
|
||||
for path in self.paths:
|
||||
self.assertTrue( man.has_watch(path) )
|
||||
|
||||
def test_remove_watch_directory(self):
|
||||
man = Manager()
|
||||
add_paths(man, self.paths)
|
||||
for path in self.paths:
|
||||
self.assertTrue( man.has_watch(path) )
|
||||
man.remove_watch_directory( path )
|
||||
self.assertTrue( not man.has_watch(path) )
|
||||
|
||||
if __name__ == '__main__': unittest.main()
|
Loading…
Add table
Add a link
Reference in a new issue