# enable enable_logging and add --nologcapture to nosetest to see debug # (should not be needed, logging is not initialized properly?) enable_logging = True if enable_logging: #level = 5 #import logging import flexget.logger flexget.logger.initialize(True) ##log = logging.getLogger() ##log.setLevel(level) # switch seriesparser logging to debug import tests from flexget.utils.titles.series import log as parser_log parser_log.setLevel(tests.setup_logging_level()) class TestSeriesParser(object): def parse(self, name, data, **kwargs): s = SeriesParser(name, **kwargs) s.parse(data) return s def parse_invalid(self, name, data, **kwargs): """Makes sure either ParseWarning is raised, or return is invalid.""" try: r = self.parse(name, data, **kwargs) assert not r.valid, '{data} should not be valid'.format(data=data) except ParseWarning:
# enable enable_logging and add --nologcapture to nosetest to see debug # (should not be needed, logging is not initialized properly?) enable_logging = True if enable_logging: #level = 5 #import logging import flexget.logger flexget.logger.initialize(True) ##log = logging.getLogger() ##log.setLevel(level) # switch seriesparser logging to debug import tests from flexget.utils.titles.series import log as parser_log parser_log.setLevel(tests.setup_logging_level()) class TestSeriesParser(object): def parse(self, name=None, data=None, **kwargs): s = SeriesParser(name, **kwargs) s.parse(data) return s def test_proper(self): """SeriesParser: proper""" s = self.parse(name='Something Interesting', data='Something.Interesting.S01E02.Proper-FlexGet') assert s.season == 1 assert s.episode == 2 assert s.quality.name == 'unknown'