def build(cls,
           *,
           dep_connection_producer=ConnectionProducer.build,
           dep_database=Database.build,
           config_prometheus_port,
           **kwargs):
     database = dep_database(**kwargs)
     bookkeeper = Bookkeeper.build(database, **kwargs)
     replays = Replays.build(bookkeeper, **kwargs)
     conns = Connections.build(replays, **kwargs)
     producer = dep_connection_producer(conns.handle_connection, **kwargs)
     return cls(producer, database, conns, replays, bookkeeper,
                config_prometheus_port)
Exemplo n.º 2
0
 def build(cls,
           *,
           dep_connection_producer=ConnectionProducer.build,
           dep_database=Database.build,
           config):
     database = dep_database(config.db)
     bookkeeper = Bookkeeper.build(database, config.storage)
     replays = Replays.build(bookkeeper, config.replay)
     conns = Connections.build(replays,
                               config.server.connection_header_read_timeout)
     producer = dep_connection_producer(conns.handle_connection,
                                        config.server.port)
     return cls(producer, database, conns, replays, bookkeeper,
                config.server.prometheus_port)
def test_replays_init(mock_bookkeeper):
    Replays.build(mock_bookkeeper, replay_config(config_dict))
def test_replays_init(mock_bookkeeper):
    Replays.build(mock_bookkeeper, **config)