def __init__(self, ): TsSummarizer.__init__(self, ) log_level = logging.DEBUG if TS_DEBUG else logging.INFO formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') fh = logging.handlers.RotatingFileHandler('./text_rank_'+TS_LOG, mode='a', encoding='utf-8', maxBytes=1000000, backupCount=5) fh.setLevel(log_level) fh.setFormatter(formatter) self.logger = logging.getLogger('ts_summarizer') self.logger.handlers = [] self.logger.addHandler(fh)
def test_summarizer_tag_display(self): """Make sure that the display of the tag is correct""" logger.info("Running the taggger test") asd = {"minutes": 60, "size": 2, "txt": u"Summary for first 60 minutes:\n"} summ = TsSummarizer() summ.set_channel("elasticsearch") summ_msg = summ.tagged_sum(TestSummarize.test_msgs[1]) logger.debug("Test summ msg is %s", summ_msg) self.assertTrue( summ_msg == "@Thu-Sep-9-2015 18:32:08 <@U0EBEC5T5>: <https://a8c.slack.com/archives/elasticsearch/p1441909928000131|because i imagine the places we link people will vary quite a bit with tests>" )
def __init__(self, ): TsSummarizer.__init__(self, ) log_level = logging.DEBUG if TS_DEBUG else logging.INFO formatter = logging.Formatter( '%(asctime)s - %(name)s - %(levelname)s - %(message)s') fh = logging.handlers.RotatingFileHandler('./spacy_' + TS_LOG, mode='a', encoding='utf-8', maxBytes=1000000, backupCount=5) fh.setLevel(log_level) fh.setFormatter(formatter) self.logger = logging.getLogger('sp_summarizer') self.logger.handlers = [] self.logger.addHandler(fh)
def test_summarizer_tag_display(self): """Make sure that the display of the tag is correct""" logger.info("Running the taggger test") asd = { 'minutes': 60, 'size': 2, 'txt': u'Summary for first 60 minutes:\n' } summ = TsSummarizer() summ.set_channel("elasticsearch") summ_msg = summ.tagged_sum(TestSummarize.test_msgs[1]) logger.debug("Test summ msg is %s", summ_msg) self.assertTrue( summ_msg == "@Thu-Sep-9-2015 18:32:08 <@U0EBEC5T5>: <https://a8c.slack.com/archives/elasticsearch/p1441909928000131|because i imagine the places we link people will vary quite a bit with tests>" )