Exemple #1
0
 def test_configure_from_dict(self):
     config_data = {
         'scribe_host': 'example.com',
         'scribe_port': '5555'
     }
     config.configure_from_dict(config_data)
     T.assert_equal(config.scribe_host, config_data['scribe_host'])
Exemple #2
0
 def test_configure_from_dict(self):
     config_data = {
         'scribe_host': 'example.com',
         'scribe_port': '5555',
     }
     config.configure_from_dict(config_data)
     assert config.scribe_host == config_data['scribe_host']
     assert not config.clog_enable_stdout_logging
Exemple #3
0
 def test_clog_enable_stdout_logging_false(self):
     config_data = {
         'clog_enable_stdout_logging': False,
     }
     config.configure_from_dict(config_data)
     assert not config.clog_enable_stdout_logging
Exemple #4
0
 def test_clog_enable_stdout_logging_true(self):
     config_data = {
         'clog_enable_stdout_logging': True,
     }
     config.configure_from_dict(config_data)
     assert config.clog_enable_stdout_logging
 def test_logging_timeout_set_0_overwrite_global_conf(self):
     config.configure_from_dict({'scribe_logging_timeout': 100})
     with self.construct_scribelogger_with_mocked_tsocket(timeout=0) as mock_logger:
         assert not mock_logger.socket.set_timeout.called
 def test_unset_logging_timeout_with_global_conf_set(self):
     config.configure_from_dict({'scribe_logging_timeout': 100})
     with self.construct_scribelogger_with_mocked_tsocket() as mock_logger:
         mock_logger.socket.set_timeout.assert_called_once_with(100)
Exemple #7
0
 def test_configure_from_dict(self):
     config_data = {"scribe_host": "example.com", "scribe_port": "5555"}
     config.configure_from_dict(config_data)
     assert config.scribe_host == config_data["scribe_host"]
     assert not config.clog_enable_stdout_logging
Exemple #8
0
 def test_clog_enable_stdout_logging_false(self):
     config_data = {"clog_enable_stdout_logging": False}
     config.configure_from_dict(config_data)
     assert not config.clog_enable_stdout_logging
Exemple #9
0
 def test_clog_enable_stdout_logging_true(self):
     config_data = {"clog_enable_stdout_logging": True}
     config.configure_from_dict(config_data)
     assert config.clog_enable_stdout_logging
Exemple #10
0
 def test_logging_timeout_set_0_overwrite_global_conf(self):
     config.configure_from_dict({'scribe_logging_timeout': 100})
     with self.construct_scribelogger_with_mocked_tsocket(
             timeout=0) as mock_logger:
         assert not mock_logger.socket.set_timeout.called
Exemple #11
0
 def test_unset_logging_timeout_with_global_conf_set(self):
     config.configure_from_dict({'scribe_logging_timeout': 100})
     with self.construct_scribelogger_with_mocked_tsocket() as mock_logger:
         mock_logger.socket.set_timeout.assert_called_once_with(100)