Пример #1
0
	def test_serie(self):
		""" testing serie object """
		bash_manager = FsSeriesStore(self.get_global_conffifile_fullpath())
		serie_list = bash_manager.get_serie_list()
		self.assertTrue(bash_manager.get_global_config_file() == 
				self.get_global_conffifile_fullpath())
		self.assertTrue("Plop" in serie_list)
		self.assertTrue("ZPlop" in serie_list)
		self.assertTrue(len(serie_list) == 2)
		
		serie_name = bash_manager.get_current_serie_name()
		self.assertTrue( serie_name == "Plop" )
Пример #2
0
	def test_conffile(self):
		""" testing test environment """
		name = 'Plop'
		bash_manager = FsSeriesStore(self.get_global_conffifile_fullpath())
		self.assertTrue(bash_manager.get_global_config_file() 
				== self.get_global_conffifile_fullpath())
		
		expected_path = self.cwd # "."
		got_path = bash_manager.get_absolute_path()
		self.assert_equivalent_path(got_path, expected_path)

		got_file = bash_manager.get_serie_configfile(name)
		expected_file = os.path.join(self.cwd, os.path.join(name, ".play_season"))

		self.assert_equivalent_path(got_file, expected_file)
		return True
Пример #3
0
	def test_pattern(self):
		""" testing file searching pattern creation"""
		bash_manager = FsSeriesStore(self.get_global_conffifile_fullpath())

		pattern = bash_manager.get_glob_pattern(1, 1, ["avi", "flv"])
		self.assertTrue(re.search(pattern, 'Bidou s01e01.avi'))
		self.assertFalse(re.search(pattern, 'Bidou s02e01.avi'))
		self.assertTrue(re.search(pattern, 'Bidou s01e01.flv'))
		self.assertFalse(re.search(pattern, 'Bidou s01e01.plop'))


		pattern = bash_manager.get_glob_pattern(1, 1, ["srt"])

		self.assertTrue(re.search(pattern, 'Bidou s01e01.srt'))
		self.assertFalse(re.search(pattern, 'Bidou s01e01.plop'))
		self.assertTrue(re.search(pattern, 
			'Dexter - 1x01 - Dexter.720p.BluRay.BoB.en.srt'))
Пример #4
0
    def configure(self, binder):
        """ configure method"""
        binder.bind(Subdownloader, to=EmptySubdownloader)

        self.install(binder, FakeControllerModule())

        config = Config(MAIN_CONF_FILE)
        binder.bind(SeriesStore, to_instance=FsSeriesStore(MAIN_CONF_FILE))
        binder.bind(Config, to_instance=config)
        binder.bind(PlayEventManager, to=PlayEventManager)
        binder.bind(SeriesData, to=FsManagedSeriesData)
        binder.bind(VideoFinderService, to_instance=app.service.Service(None))
Пример #5
0
    def configure(self, binder):
        """ binding definition """

        binder.bind(Subdownloader, to=TVsubtitlesSubdownloader)
        self.install(binder, ControllerModule())
        binder.bind(ControllerFactory, to=ControllerFactory)

        store = FsSeriesStore()
        config = Config()

        binder.bind(SeriesStore, to_instance=store)
        binder.bind(Config, to_instance=config)

        binder.bind(SeriesData, to=FsManagedSeriesData)
        binder.bind(VideoFinderService,
                    to_instance=PipeService(
                        ["video_finder_server.py", "-D", "debug"]))
Пример #6
0
			def configure(self_, binder):
				""" bindings """
				store = FsSeriesStore(self.get_global_conffifile_fullpath())
				binder.bind(SeriesStore, to_instance = store)
				binder.bind(SeriesData, to = FsManagedSeriesData)
Пример #7
0
	def test_manager(self):
		""" Test of manager : retrieving season path"""
		fs_store = FsSeriesStore(self.get_global_conffifile_fullpath())
		# datas = BashManagedSeriesData(bash_manager)
		got = fs_store.get_path_to_season("Plop", 2)
		self.assert_equivalent_path(got, os.path.join(self.cwd,"Plop/Season 2"))
	def test_dl(self):
		bash_manager = FsSeriesStore(MAIN_CONF_FILE)