def test_Finder(self): Configuration.load("./LogSpider/debug.yml") Finder.finder({ 'logType': 'mis_clt', 'FileDate': '20190116', 'TraceNo': '540002' })
def setUp(self): Configuration.load("./LogSpider/debug.yml")
def test_e_self_check(self): Configuration.load("") self.assertTrue(Configuration.self_check())
def test_n_self_check(self): self.assertTrue(Configuration.self_check())
def test_e_get_re(self): self.assertIsInstance(Configuration.get_re("xxxxx"), dict)
def test_n_get_re(self): self.assertIsInstance(Configuration.get_re("postran"), dict)
def test_e_load(self): self.assertFalse(Configuration.load()) self.assertFalse(Configuration.load("")) self.assertFalse(Configuration.load(None))
def test_n_load(self): Configuration.load("./LogSpider/debug.yml")
def test_n_file_names(self): Configuration.load("./LogSpider/debug.yml") result = Sensor.file_names(user_dir='/home/vagrant/shop/log') self.assertIsInstance(result,list,"返回值是否为列表")
def test_e_sensor(self): Configuration.load("") print(Configuration.db_path) self.assertFalse(Sensor.sensor())
def test_n_sensor(self): Configuration.load("./LogSpider/debug.yml") Sensor.sensor()
def test_LogSpider(self): Configuration.load("./LogSpider/debug.yml") #Spider.spider(file_date="20170221",log_type=Configuration.logType) Spider.spider(file_date="20170221", log_type=["postran"])
def test_e_key_words_marching(self): Configuration.load("./LogSpider/debug.yml") self.assertFalse(Library.key_words_marching("xxx"))
def test_n_key_words_marching(self): Configuration.load("./LogSpider/debug.yml") self.assertTrue(Library.key_words_marching("Rrn"))
def test_n_spider(self): Configuration.load("./LogSpider/debug.yml") self.assertTrue( Spider.spider(file_date="20170221", log_type=["postran"]))