def test_retrieve_files_no_results(self, mock_walk, mock_access): mock_access.return_value = False mock_walk.return_value = [('/tmp/videos', [], ['video1.mp4'])] locations = ['/tmp/videos'] self.CONF.set_override('locations', locations) self.assertEqual(watcher.retrieve_files(), [])
def test_retrieve_files_no_results(self, mock_walk, mock_access): mock_access.return_value = False mock_walk.return_value = [('/tmp/videos', [], ['video1.mp4'] )] locations = ['/tmp/videos'] self.CONF.set_override('locations', locations) self.assertEqual(watcher.retrieve_files(), [])
def _start(processor_mgr): LOG.debug('tvrenamer starting...') outputs = [] for afile in watcher.retrieve_files(): next_ep = episode.Episode(afile) # process the work outputs.append(next_ep()) processor_mgr.map_method('process', outputs) LOG.debug('tvrenamer finished')
def test_retrieve_files(self, mock_walk, mock_access): mock_access.return_value = True mock_walk.return_value = [ ('/tmp/videos', [], ['video1.mp4', 'video2.avi', 'video3.mkv', 'video4.mov']) ] locations = ['/tmp/videos'] self.CONF.set_override('locations', locations) self.assertEqual(watcher.retrieve_files(), [ '/tmp/videos/video1.mp4', '/tmp/videos/video2.avi', '/tmp/videos/video3.mkv', '/tmp/videos/video4.mov' ])
def test_retrieve_files_nas_path(self, mock_walk, mock_access): mock_access.return_value = True mock_walk.return_value = [ ('\\NAS/Share/Video', [], ['video1.mp4', 'video2.avi', 'video3.mkv', 'video4.mov']) ] locations = ['\\NAS/Share/Video'] self.CONF.set_override('locations', locations) self.assertEqual(watcher.retrieve_files(), [ '\\NAS/Share/Video/video1.mp4', '\\NAS/Share/Video/video2.avi', '\\NAS/Share/Video/video3.mkv', '\\NAS/Share/Video/video4.mov' ])
def test_retrieve_files(self, mock_walk, mock_access): mock_access.return_value = True mock_walk.return_value = [('/tmp/videos', [], ['video1.mp4', 'video2.avi', 'video3.mkv', 'video4.mov'] )] locations = ['/tmp/videos'] self.CONF.set_override('locations', locations) self.assertEqual(watcher.retrieve_files(), ['/tmp/videos/video1.mp4', '/tmp/videos/video2.avi', '/tmp/videos/video3.mkv', '/tmp/videos/video4.mov'])
def test_retrieve_files_nas_path(self, mock_walk, mock_access): mock_access.return_value = True mock_walk.return_value = [('\\NAS/Share/Video', [], ['video1.mp4', 'video2.avi', 'video3.mkv', 'video4.mov'] )] locations = ['\\NAS/Share/Video'] self.CONF.set_override('locations', locations) self.assertEqual(watcher.retrieve_files(), ['\\NAS/Share/Video/video1.mp4', '\\NAS/Share/Video/video2.avi', '\\NAS/Share/Video/video3.mkv', '\\NAS/Share/Video/video4.mov'])