Open
Description
Describe the bug
Using the Python API example works perfectly in a virtual environment.
Fails when run in a docker container with a time out.
HTTPConnectionPool(host='172.17.0.1', port=63342): Max retries exceeded with url:
To Reproduce
import os
import pathlib as pl
import shutil
import pytest
from gcp_storage_emulator.server import create_server
from google.auth.credentials import AnonymousCredentials
from google.cloud import storage
import upload
@pytest.fixture
def mock_storage_client():
"""Google Cloud Storage emulator"""
host = "localhost"
port = 9023
server = create_server(host, port, in_memory=True)
server.start()
os.environ["STORAGE_EMULATOR_HOST"] = f"http://{host}:{port}"
yield storage.Client(credentials=AnonymousCredentials(), project="test-project")
server.stop()
del os.environ["STORAGE_EMULATOR_HOST"]
def test_upload_folder(mock_storage_client):
"""Test uploading a folder to Google Cloud Storage"""
bucket_name = "test-upload-bucket"
mock_storage_client.create_bucket(bucket_name)
Expected behavior
Bucket is created.
System (please complete the following information):
- OS version: macos / linux
- Python version: 3.9
- gcp-storage-emulator version: latest
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
No labels