Example #1
0
File: logger_t.py Project: 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
Example #2
0
File: logger_t.py Project: 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
Example #3
0
File: logger_t.py Project: 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
Example #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
Example #5
0
File: logger_t.py Project: 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
Example #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
Example #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
Example #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
Example #9
0
File: logger_t.py Project: ktf/DAS
 def test_funcname(self):
     "Test funcname"
     result = funcname()
     expect = 'test_funcname'
     self.assertEqual(expect, result)
Example #10
0
 def test_funcname(self):
     "Test funcname"
     result = funcname()
     expect = 'test_funcname'
     self.assertEqual(expect, result)