def create_layers(context, num_layers): layers = [] for i in range(num_layers): # dev_mode is True because otherwise the layer's ip is set to the # public ip of the node ob_ctx = OpenBazaarContext.create_default_instance() ob_ctx.dev_mode = True ob_ctx.server_ip = ip_address(i) ob_ctx.server_port = port db_path = get_db_path(i) setup_db(db_path, ob_ctx.disable_sqlite_crypt) layers.append(CryptoTransportLayer(ob_ctx, Obdb(db_path))) context.layers = layers
def create_layers(context, num_layers): layers = [] for i in range(num_layers): # dev_mode is True because otherwise the layer's ip is set to the # public ip of the node ob_ctx = OpenBazaarContext.create_default_instance() ob_ctx.dev_mode = True ob_ctx.server_ip = ip_address(i) ob_ctx.server_port = PORT db_path = get_db_path(i) setup_db(db_path, ob_ctx.disable_sqlite_crypt) layers.append(CryptoTransportLayer(ob_ctx, Obdb(db_path))) context.layers = layers
def get_mock_open_bazaar_context(): return OpenBazaarContext.create_default_instance()
def get_mock_open_bazaar_context(): return OpenBazaarContext.create_default_instance()
def setUp(self): self.default_ctx = OpenBazaarContext.create_default_instance()