예제 #1
0
    def test_get_summary(self):
        logger = Logger()
        logger.get_warnings = MagicMock(return_value=['the warnings'])
        logger.get_errors = MagicMock(return_value=['the errors'])
        logger.get_log_counts = MagicMock(return_value={'the': 'log counts'})

        self.assertEqual({
            'warnings': ['the warnings'],
            'errors': ['the errors'],
            'log_counts': {'the': 'log counts'}
        }, logger.get_summary())
예제 #2
0
 def test_get_errors(self):
     logger = Logger()
     logger.messages['error'] = 'error messages'
     self.assertEqual('error messages', logger.get_errors())
예제 #3
0
 def test_get_errors(self):
     logger = Logger()
     logger.messages['error'] = ['error messages']
     self.assertEqual(['error messages'], logger.get_errors())
     logger.messages['data_error'] = ['data error messages']
     self.assertEqual(['error messages', 'data error messages'], logger.get_errors())