Exemplo n.º 1
0
Arquivo: test.py Projeto: grnet/kamaki
 def tearDown(self):
     self.PseudoLogger._setLevel_calls = []
     self.PseudoLogger._addHandler_calls = []
     self.PseudoLogger._setFormatter_calls = []
     from kamaki.cli.logger import LOG_FILE, _blacklist
     for e in LOG_FILE:
         LOG_FILE.pop()
     for e in self.LF:
         LOG_FILE.append(e)
     _blacklist.clear()
     _blacklist.update(self.BL)
Exemplo n.º 2
0
 def tearDown(self):
     self.PseudoLogger._setLevel_calls = []
     self.PseudoLogger._addHandler_calls = []
     self.PseudoLogger._setFormatter_calls = []
     from kamaki.cli.logger import LOG_FILE, _blacklist
     for e in LOG_FILE:
         LOG_FILE.pop()
     for e in self.LF:
         LOG_FILE.append(e)
     _blacklist.clear()
     _blacklist.update(self.BL)
Exemplo n.º 3
0
Arquivo: test.py Projeto: grnet/kamaki
 def test_get_log_filename(self):
     from kamaki.cli.logger import get_log_filename, LOG_FILE
     f = NamedTemporaryFile()
     for e in LOG_FILE:
         LOG_FILE.pop()
     LOG_FILE.append(f.name)
     self.assertEqual(get_log_filename(), f.name)
     LOG_FILE.pop()
     LOG_FILE.append(2 * f.name)
     print('\n  Should print error msg here: ')
     self.assertEqual(get_log_filename(), None)
Exemplo n.º 4
0
 def test_get_log_filename(self):
     from kamaki.cli.logger import get_log_filename, LOG_FILE
     f = NamedTemporaryFile()
     for e in LOG_FILE:
         LOG_FILE.pop()
     LOG_FILE.append(f.name)
     self.assertEqual(get_log_filename(), f.name)
     LOG_FILE.pop()
     LOG_FILE.append(2 * f.name)
     print('\n  Should print error msg here: ')
     self.assertEqual(get_log_filename(), None)