def test_verbose_level_two_enables_debug_messages(self, fake_get_logger): with patch.object(run, 'enable_debug_log_messages') as enable_debug: run.setup_logging(2) enable_debug.assert_called_once_with()
def test_verbse_level_zero_sets_null_handler(self, fake_get_logger): with patch.object(run, 'set_null_log_handler') as fake_set_null: run.setup_logging(0) fake_set_null.assert_called_once_with(fake_get_logger.return_value)
def test_verbose_level_one_sets_stream_handler(self, fake_get_logger): with patch.object(run, 'set_stderr_stream_handler') as stderr_handler: run.setup_logging(1) stderr_handler.assert_called_once_with( fake_get_logger.return_value)
def test_setup_logging_calls_set_log_verbose_for_vv(self, patch_set_log): with patch.object(run, 'get_root_logger'): run.setup_logging(self.verbose_level_vv) patch_set_log.assert_called_once_with(True)
def test_setup_logging_sets_root_logging_level_to_debug_with_vv(self): with patch.object(run, 'get_root_logger') as fake_get_logger: run.setup_logging(self.verbose_level_vv) fake_get_logger.return_value.setLevel.assert_called_with( logging.DEBUG)
def test_setup_logging_keeps_root_logging_level_at_info_for_v(self): with patch.object(run, 'get_root_logger') as fake_get_logger: run.setup_logging(self.verbose_level_v) fake_get_logger.return_value.setLevel.assert_called_once_with( logging.INFO)
def test_setup_logging_defaults_to_info_level(self): with patch.object(run, 'get_root_logger') as fake_get_logger: run.setup_logging(self.verbose_level_none) fake_get_logger.return_value.setLevel.assert_called_once_with( logging.INFO)
def test_setup_logging_calls_get_root_logger(self): with patch.object(run, 'get_root_logger') as fake_get_root_logger: run.setup_logging(self.verbose_level_none) fake_get_root_logger.assert_called_once_with()