Skip to content

Commit abf9c90

Browse files
Rename inactive_database fixture to inactive_cloud_database (#3005)
Update the fixture name throughout the codebase for consistency with naming conventions. Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 4e76f60 commit abf9c90

3 files changed

Lines changed: 23 additions & 23 deletions

File tree

tests/conftest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,22 @@ def cloud_reco_client(vuforia_database: CloudDatabase) -> CloudRecoService:
4040

4141

4242
@pytest.fixture(name="inactive_vws_client")
43-
def fixture_inactive_vws_client(inactive_database: CloudDatabase) -> VWS:
43+
def fixture_inactive_vws_client(inactive_cloud_database: CloudDatabase) -> VWS:
4444
"""A client for an inactive VWS database."""
4545
return VWS(
46-
server_access_key=inactive_database.server_access_key,
47-
server_secret_key=inactive_database.server_secret_key,
46+
server_access_key=inactive_cloud_database.server_access_key,
47+
server_secret_key=inactive_cloud_database.server_secret_key,
4848
)
4949

5050

5151
@pytest.fixture
5252
def inactive_cloud_reco_client(
53-
inactive_database: CloudDatabase,
53+
inactive_cloud_database: CloudDatabase,
5454
) -> CloudRecoService:
5555
"""A query client for an inactive VWS database."""
5656
return CloudRecoService(
57-
client_access_key=inactive_database.client_access_key,
58-
client_secret_key=inactive_database.client_secret_key,
57+
client_access_key=inactive_cloud_database.client_access_key,
58+
client_secret_key=inactive_cloud_database.client_secret_key,
5959
)
6060

6161

tests/mock_vws/fixtures/credentials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def vuforia_database() -> CloudDatabase:
7676

7777

7878
@pytest.fixture
79-
def inactive_database() -> CloudDatabase:
79+
def inactive_cloud_database() -> CloudDatabase:
8080
"""
8181
Return VWS credentials for an inactive project from environment
8282
variables.

tests/mock_vws/fixtures/vuforia_backends.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ def _vumark_database(
8484
def _enable_use_real_vuforia(
8585
*,
8686
working_database: CloudDatabase,
87-
inactive_database: CloudDatabase,
87+
inactive_cloud_database: CloudDatabase,
8888
vumark_vuforia_database: VuMarkCloudDatabase,
8989
monkeypatch: pytest.MonkeyPatch,
9090
) -> Generator[None]:
9191
"""Test against the real Vuforia."""
9292
assert monkeypatch
93-
assert inactive_database
93+
assert inactive_cloud_database
9494
assert vumark_vuforia_database
9595
_delete_all_targets(database_keys=working_database)
9696
yield
@@ -100,7 +100,7 @@ def _enable_use_real_vuforia(
100100
def _enable_use_mock_vuforia(
101101
*,
102102
working_database: CloudDatabase,
103-
inactive_database: CloudDatabase,
103+
inactive_cloud_database: CloudDatabase,
104104
vumark_vuforia_database: VuMarkCloudDatabase,
105105
monkeypatch: pytest.MonkeyPatch,
106106
) -> Generator[None]:
@@ -114,21 +114,21 @@ def _enable_use_mock_vuforia(
114114
client_secret_key=working_database.client_secret_key,
115115
)
116116

117-
inactive_database = CloudDatabase(
117+
inactive_cloud_database = CloudDatabase(
118118
state=States.PROJECT_INACTIVE,
119-
database_name=inactive_database.database_name,
120-
server_access_key=inactive_database.server_access_key,
121-
server_secret_key=inactive_database.server_secret_key,
122-
client_access_key=inactive_database.client_access_key,
123-
client_secret_key=inactive_database.client_secret_key,
119+
database_name=inactive_cloud_database.database_name,
120+
server_access_key=inactive_cloud_database.server_access_key,
121+
server_secret_key=inactive_cloud_database.server_secret_key,
122+
client_access_key=inactive_cloud_database.client_access_key,
123+
client_secret_key=inactive_cloud_database.client_secret_key,
124124
)
125125
vumark_database = _vumark_database(
126126
vumark_vuforia_database=vumark_vuforia_database,
127127
)
128128

129129
with MockVWS() as mock:
130130
mock.add_cloud_database(cloud_database=working_database)
131-
mock.add_cloud_database(cloud_database=inactive_database)
131+
mock.add_cloud_database(cloud_database=inactive_cloud_database)
132132
mock.add_vumark_database(vumark_database=vumark_database)
133133
yield
134134

@@ -137,7 +137,7 @@ def _enable_use_mock_vuforia(
137137
def _enable_use_docker_in_memory(
138138
*,
139139
working_database: CloudDatabase,
140-
inactive_database: CloudDatabase,
140+
inactive_cloud_database: CloudDatabase,
141141
vumark_vuforia_database: VuMarkCloudDatabase,
142142
monkeypatch: pytest.MonkeyPatch,
143143
) -> Generator[None]:
@@ -211,7 +211,7 @@ def _enable_use_docker_in_memory(
211211
)
212212
requests.post(
213213
url=cloud_databases_url,
214-
json=inactive_database.to_dict(),
214+
json=inactive_cloud_database.to_dict(),
215215
timeout=30,
216216
)
217217
requests.post(
@@ -289,7 +289,7 @@ def pytest_collection_modifyitems(
289289
def fixture_verify_mock_vuforia(
290290
request: pytest.FixtureRequest,
291291
vuforia_database: CloudDatabase,
292-
inactive_database: CloudDatabase,
292+
inactive_cloud_database: CloudDatabase,
293293
vumark_vuforia_database: VuMarkCloudDatabase,
294294
monkeypatch: pytest.MonkeyPatch,
295295
) -> Generator[None]:
@@ -317,7 +317,7 @@ def fixture_verify_mock_vuforia(
317317

318318
yield from enable_function(
319319
working_database=vuforia_database,
320-
inactive_database=inactive_database,
320+
inactive_cloud_database=inactive_cloud_database,
321321
vumark_vuforia_database=vumark_vuforia_database,
322322
monkeypatch=monkeypatch,
323323
)
@@ -335,7 +335,7 @@ def fixture_verify_mock_vuforia(
335335
def mock_only_vuforia(
336336
request: pytest.FixtureRequest,
337337
vuforia_database: CloudDatabase,
338-
inactive_database: CloudDatabase,
338+
inactive_cloud_database: CloudDatabase,
339339
vumark_vuforia_database: VuMarkCloudDatabase,
340340
monkeypatch: pytest.MonkeyPatch,
341341
) -> Generator[None]:
@@ -363,7 +363,7 @@ def mock_only_vuforia(
363363

364364
yield from enable_function(
365365
working_database=vuforia_database,
366-
inactive_database=inactive_database,
366+
inactive_cloud_database=inactive_cloud_database,
367367
vumark_vuforia_database=vumark_vuforia_database,
368368
monkeypatch=monkeypatch,
369369
)

0 commit comments

Comments
 (0)