Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ def cloud_reco_client(vuforia_database: CloudDatabase) -> CloudRecoService:


@pytest.fixture(name="inactive_vws_client")
def fixture_inactive_vws_client(inactive_database: CloudDatabase) -> VWS:
def fixture_inactive_vws_client(inactive_cloud_database: CloudDatabase) -> VWS:
"""A client for an inactive VWS database."""
return VWS(
server_access_key=inactive_database.server_access_key,
server_secret_key=inactive_database.server_secret_key,
server_access_key=inactive_cloud_database.server_access_key,
server_secret_key=inactive_cloud_database.server_secret_key,
)


@pytest.fixture
def inactive_cloud_reco_client(
inactive_database: CloudDatabase,
inactive_cloud_database: CloudDatabase,
) -> CloudRecoService:
"""A query client for an inactive VWS database."""
return CloudRecoService(
client_access_key=inactive_database.client_access_key,
client_secret_key=inactive_database.client_secret_key,
client_access_key=inactive_cloud_database.client_access_key,
client_secret_key=inactive_cloud_database.client_secret_key,
)


Expand Down
2 changes: 1 addition & 1 deletion tests/mock_vws/fixtures/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def vuforia_database() -> CloudDatabase:


@pytest.fixture
def inactive_database() -> CloudDatabase:
def inactive_cloud_database() -> CloudDatabase:
"""
Return VWS credentials for an inactive project from environment
variables.
Expand Down
32 changes: 16 additions & 16 deletions tests/mock_vws/fixtures/vuforia_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ def _vumark_database(
def _enable_use_real_vuforia(
*,
working_database: CloudDatabase,
inactive_database: CloudDatabase,
inactive_cloud_database: CloudDatabase,
vumark_vuforia_database: VuMarkCloudDatabase,
monkeypatch: pytest.MonkeyPatch,
) -> Generator[None]:
"""Test against the real Vuforia."""
assert monkeypatch
assert inactive_database
assert inactive_cloud_database
assert vumark_vuforia_database
_delete_all_targets(database_keys=working_database)
yield
Expand All @@ -100,7 +100,7 @@ def _enable_use_real_vuforia(
def _enable_use_mock_vuforia(
*,
working_database: CloudDatabase,
inactive_database: CloudDatabase,
inactive_cloud_database: CloudDatabase,
vumark_vuforia_database: VuMarkCloudDatabase,
monkeypatch: pytest.MonkeyPatch,
) -> Generator[None]:
Expand All @@ -114,21 +114,21 @@ def _enable_use_mock_vuforia(
client_secret_key=working_database.client_secret_key,
)

inactive_database = CloudDatabase(
inactive_cloud_database = CloudDatabase(
state=States.PROJECT_INACTIVE,
database_name=inactive_database.database_name,
server_access_key=inactive_database.server_access_key,
server_secret_key=inactive_database.server_secret_key,
client_access_key=inactive_database.client_access_key,
client_secret_key=inactive_database.client_secret_key,
database_name=inactive_cloud_database.database_name,
server_access_key=inactive_cloud_database.server_access_key,
server_secret_key=inactive_cloud_database.server_secret_key,
client_access_key=inactive_cloud_database.client_access_key,
client_secret_key=inactive_cloud_database.client_secret_key,
)
vumark_database = _vumark_database(
vumark_vuforia_database=vumark_vuforia_database,
)

with MockVWS() as mock:
mock.add_cloud_database(cloud_database=working_database)
mock.add_cloud_database(cloud_database=inactive_database)
mock.add_cloud_database(cloud_database=inactive_cloud_database)
mock.add_vumark_database(vumark_database=vumark_database)
yield

Expand All @@ -137,7 +137,7 @@ def _enable_use_mock_vuforia(
def _enable_use_docker_in_memory(
*,
working_database: CloudDatabase,
inactive_database: CloudDatabase,
inactive_cloud_database: CloudDatabase,
vumark_vuforia_database: VuMarkCloudDatabase,
monkeypatch: pytest.MonkeyPatch,
) -> Generator[None]:
Expand Down Expand Up @@ -211,7 +211,7 @@ def _enable_use_docker_in_memory(
)
requests.post(
url=cloud_databases_url,
json=inactive_database.to_dict(),
json=inactive_cloud_database.to_dict(),
timeout=30,
)
requests.post(
Expand Down Expand Up @@ -289,7 +289,7 @@ def pytest_collection_modifyitems(
def fixture_verify_mock_vuforia(
request: pytest.FixtureRequest,
vuforia_database: CloudDatabase,
inactive_database: CloudDatabase,
inactive_cloud_database: CloudDatabase,
vumark_vuforia_database: VuMarkCloudDatabase,
monkeypatch: pytest.MonkeyPatch,
) -> Generator[None]:
Expand Down Expand Up @@ -317,7 +317,7 @@ def fixture_verify_mock_vuforia(

yield from enable_function(
working_database=vuforia_database,
inactive_database=inactive_database,
inactive_cloud_database=inactive_cloud_database,
vumark_vuforia_database=vumark_vuforia_database,
monkeypatch=monkeypatch,
)
Expand All @@ -335,7 +335,7 @@ def fixture_verify_mock_vuforia(
def mock_only_vuforia(
request: pytest.FixtureRequest,
vuforia_database: CloudDatabase,
inactive_database: CloudDatabase,
inactive_cloud_database: CloudDatabase,
vumark_vuforia_database: VuMarkCloudDatabase,
monkeypatch: pytest.MonkeyPatch,
) -> Generator[None]:
Expand Down Expand Up @@ -363,7 +363,7 @@ def mock_only_vuforia(

yield from enable_function(
working_database=vuforia_database,
inactive_database=inactive_database,
inactive_cloud_database=inactive_cloud_database,
vumark_vuforia_database=vumark_vuforia_database,
monkeypatch=monkeypatch,
)