Skip to content

Commit de5ff16

Browse files
committed
Fix tests
1 parent bdcdcb8 commit de5ff16

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

graphdatascience/tests/unit/test_aura_api.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ def test_create_instance(requests_mock: Mocker) -> None:
8585
api = AuraApi(client_id="", client_secret="", tenant_id="some-tenant")
8686

8787
mock_auth_token(requests_mock)
88+
89+
requests_mock.get(
90+
"https://api.neo4j.io/v1/tenants/some-tenant",
91+
json={"data": {
92+
"id": "some_tenant",
93+
"instance_configurations": [{"type": "enterprise-ds", "region": "leipzig-1", "cloud_provider": "aws"}]
94+
}},
95+
)
96+
8897
requests_mock.post(
8998
"https://api.neo4j.io/v1/instances",
9099
json={
@@ -103,7 +112,7 @@ def test_create_instance(requests_mock: Mocker) -> None:
103112

104113
api.create_instance("name", "16GB", "gcp", "leipzig-1")
105114

106-
requested_data = requests_mock.request_history[1].json()
115+
requested_data = requests_mock.request_history[-1].json()
107116
assert requested_data["name"] == "name"
108117
assert requested_data["memory"] == "16GB"
109118
assert requested_data["cloud_provider"] == "gcp"

graphdatascience/tests/unit/test_gds_sessions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def test_create_session_invalid_region(aura_api: AuraApi) -> None:
406406
sessions._aura_api = aura_api
407407

408408
expected_message = (
409-
"Region `only-db-region` is not supported by the tenant `tenant_id`." " Supported regions: {'leipzig-1'}."
409+
"Region `only-db-region` is not supported by the tenant `tenant_id`." " Supported regions: {'leipzig-1', 'dresden-2'}."
410410
)
411411
with pytest.raises(ValueError, match=expected_message):
412412
sessions.get_or_create(

0 commit comments

Comments
 (0)