Exemplo n.º 1
0
Arquivo: logger_t.py Projeto: ktf/DAS
 def test_debug(self):
     "Test logger debug method"
     old_stdout = sys.stdout
     logger = PrintManager(self.name, verbose=2)
     sys.stdout = StringIO()
     logger.debug('test')
     result = sys.stdout.getvalue()
     expect = 'DEBUG %s:%s test\n' % (self.name, funcname())
     self.assertEqual(expect, result)
     sys.stdout = old_stdout
Exemplo n.º 2
0
Arquivo: logger_t.py Projeto: ktf/DAS
 def test_warning(self):
     "Test logger warning method"
     old_stdout = sys.stdout
     logger = PrintManager(self.name) # verbose is irrelevant
     sys.stdout = StringIO()
     logger.warning('test')
     result = sys.stdout.getvalue()
     expect = 'WARNING %s:%s test\n' % (self.name, funcname())
     self.assertEqual(expect, result)
     sys.stdout = old_stdout
Exemplo n.º 3
0
Arquivo: logger_t.py Projeto: ktf/DAS
 def test_info(self):
     "Test logger info method"
     old_stdout = sys.stdout
     logger = PrintManager(self.name, verbose=1)
     sys.stdout = StringIO()
     logger.info('test')
     result = sys.stdout.getvalue()
     expect = 'INFO %s:%s test\n' % (self.name, funcname())
     self.assertEqual(expect, result)
     sys.stdout = old_stdout
Exemplo n.º 4
0
 def test_debug(self):
     "Test logger debug method"
     old_stdout = sys.stdout
     logger = PrintManager(self.name, verbose=2)
     sys.stdout = StringIO.StringIO()
     logger.debug('test')
     result = sys.stdout.getvalue()
     expect = 'DEBUG %s:%s test\n' % (self.name, funcname())
     self.assertEqual(expect, result)
     sys.stdout = old_stdout
Exemplo n.º 5
0
Arquivo: logger_t.py Projeto: ktf/DAS
 def test_error(self):
     "Test logger error method"
     old_stdout = sys.stdout
     logger = PrintManager(self.name) # verbose is irrelevant
     sys.stdout = StringIO()
     logger.error('test')
     result = sys.stdout.getvalue()
     expect = 'ERROR %s:%s test\n' % (self.name, funcname())
     self.assertEqual(expect, result)
     sys.stdout = old_stdout
Exemplo n.º 6
0
 def test_info(self):
     "Test logger info method"
     old_stdout = sys.stdout
     logger = PrintManager(self.name, verbose=1)
     sys.stdout = StringIO.StringIO()
     logger.info('test')
     result = sys.stdout.getvalue()
     expect = 'INFO %s:%s test\n' % (self.name, funcname())
     self.assertEqual(expect, result)
     sys.stdout = old_stdout
Exemplo n.º 7
0
 def test_warning(self):
     "Test logger warning method"
     old_stdout = sys.stdout
     logger = PrintManager(self.name)  # verbose is irrelevant
     sys.stdout = StringIO.StringIO()
     logger.warning('test')
     result = sys.stdout.getvalue()
     expect = 'WARNING %s:%s test\n' % (self.name, funcname())
     self.assertEqual(expect, result)
     sys.stdout = old_stdout
Exemplo n.º 8
0
 def test_error(self):
     "Test logger error method"
     old_stdout = sys.stdout
     logger = PrintManager(self.name)  # verbose is irrelevant
     sys.stdout = StringIO.StringIO()
     logger.error('test')
     result = sys.stdout.getvalue()
     expect = 'ERROR %s:%s test\n' % (self.name, funcname())
     self.assertEqual(expect, result)
     sys.stdout = old_stdout
Exemplo n.º 9
0
Arquivo: logger_t.py Projeto: ktf/DAS
 def test_funcname(self):
     "Test funcname"
     result = funcname()
     expect = 'test_funcname'
     self.assertEqual(expect, result)
Exemplo n.º 10
0
 def test_funcname(self):
     "Test funcname"
     result = funcname()
     expect = 'test_funcname'
     self.assertEqual(expect, result)