Ejemplo n.º 1
0
 def setUpClass(cls):
     log_config.create_logger(None)
     log_config.set_level(
         ["bxcommon", "bxgateway", "bxrelay", "bxgateway_internal"],
         LogLevel.DEBUG)
     http_service.get_json = MagicMock()
     http_service.post_json = MagicMock()
     http_service.patch_json = MagicMock()
     http_service.delete_json = MagicMock()
     memory_statistics.start_recording = MagicMock()
Ejemplo n.º 2
0
 def setUp(self):
     self.blockchain_network = helpers.blockchain_network(
         protocol="Bitcoin",
         network_name="Mainnet",
         network_num=1,
         block_interval=600,
         final_tx_confirmations_count=6)
     opts = {
         "log_path":
         "",
         "to_stdout":
         True,
         "external_port":
         0,
         "node_id":
         "Test-Node-1",
         "blockchain_network":
         self.blockchain_network.network,
         "network_num":
         self.blockchain_network.network_num,
         "blockchain_protocol":
         self.blockchain_network.protocol,
         "blockchain_networks": [self.blockchain_network],
         "log_level":
         LogLevel.INFO,
         "log_format":
         LogFormat.PLAIN,
         "log_flush_immediately":
         True,
         "use_extensions":
         True,
         "thread_pool_parallelism_degree":
         config.get_thread_pool_parallelism_degree(
             str(constants.DEFAULT_THREAD_POOL_PARALLELISM_DEGREE), ),
         "log_level_overrides": {}
     }
     self.opts = Namespace()
     self.opts.__dict__ = opts
     log_config.create_logger(None, LogLevel.WARNING)
     self.event_loop_mock = EventLoopMock()
 def setUpClass(cls):
     super().setUpClass()
     log_config.create_logger(None, log_level=LogLevel.INFO)
Ejemplo n.º 4
0
 def setUp(self):
     self.blockchain_network = helpers.blockchain_network(
         protocol="Bitcoin",
         network_name="Mainnet",
         network_num=1,
         block_interval=600,
         final_tx_confirmations_count=6)
     self.set_ssl_folder()
     opts = {
         "log_path":
         "",
         "to_stdout":
         True,
         "external_port":
         0,
         "external_ip":
         "1.1.1.1",
         "node_id":
         None,
         "blockchain_network":
         self.blockchain_network.network,
         "network_num":
         self.blockchain_network.network_num,
         "blockchain_protocol":
         self.blockchain_network.protocol,
         "blockchain_networks": {
             self.blockchain_network.network_num: self.blockchain_network
         },
         "log_level":
         LogLevel.INFO,
         "log_format":
         LogFormat.PLAIN,
         "log_flush_immediately":
         True,
         "log_fluentd_enable":
         False,
         "log_fluentd_host":
         None,
         "use_extensions":
         True,
         "log_fluentd_queue_size":
         1000,
         "thread_pool_parallelism_degree":
         config.get_thread_pool_parallelism_degree(
             str(constants.DEFAULT_THREAD_POOL_PARALLELISM_DEGREE), ),
         "log_level_overrides": {},
         "source_version":
         "v1.0.0",
         "ca_cert_url":
         self.ssl_folder_url,
         "private_ssl_base_url":
         self.ssl_folder_url,
         "data_dir":
         config.get_default_data_path(),
         "log_level_fluentd":
         LogLevel.DEBUG,
         "log_level_stdout":
         LogLevel.TRACE,
         "sdn_url":
         "https://localhost:8080",
     }
     for item in CommonOpts.__dataclass_fields__:
         if item not in opts:
             opts[item] = None
     self.opts = CommonOpts.from_opts(Namespace(**opts))
     log_config.create_logger(None, LogLevel.WARNING)
     self.event_loop_mock = EventLoopMock()
Ejemplo n.º 5
0
 def setUpClass(cls):
     log_config.create_logger(None,
                              root_log_level=LogLevel.FATAL,
                              folder_path="./logs/")
     memory_statistics.start_recording = MagicMock()
Ejemplo n.º 6
0
 def setUpClass(cls) -> None:
     log_config.create_logger(None)