Skip to content

Commit d545465

Browse files
committed
test(mongodb): add cassette for create_snapshot with naive expires_at
1 parent 9582f32 commit d545465

File tree

2 files changed

+65
-1
lines changed

2 files changed

+65
-1
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
interactions:
2+
- request:
3+
body: '{"instance_id": "dd5cd838-525b-4395-b2ae-4dec3381ceaf", "name": "sdk-python-test-snapshot",
4+
"expires_at": "2025-11-04T11:16:49.007353+00:00"}'
5+
headers:
6+
Content-Length:
7+
- '141'
8+
user-agent:
9+
- scaleway-sdk-python/2.0.0
10+
method: POST
11+
uri: https://api.scaleway.com/mongodb/v1/regions/fr-par/snapshots
12+
response:
13+
body:
14+
string: '{"id": "7d68eb22-4529-452b-af73-160cc621427f", "instance_id": "dd5cd838-525b-4395-b2ae-4dec3381ceaf",
15+
"instance_name": "mgdb-magical-curie", "name": "sdk-python-test-snapshot",
16+
"status": "creating", "created_at": "2025-11-03T10:16:49.164635Z", "updated_at":
17+
"2025-11-03T10:16:49.164635Z", "expires_at": "2025-11-04T11:16:49.007353Z",
18+
"size_bytes": 0, "node_type": "mgdb-play2-nano", "volume_type": "sbs_5k",
19+
"region": "fr-par"}'
20+
headers:
21+
content-length:
22+
- '415'
23+
date:
24+
- Mon, 03 Nov 2025 10:16:49 GMT
25+
server:
26+
- Scaleway API Gateway (fr-par-3;edge01)
27+
x-request-id:
28+
- 68289a8d-c836-47bb-8e92-9ff15be8b012
29+
status:
30+
code: 200
31+
message: OK
32+
- request:
33+
body: '{"instance_id": "dd5cd838-525b-4395-b2ae-4dec3381ceaf", "name": "sdk-python-test-snapshot",
34+
"expires_at": "2025-11-04T11:19:08.742558+00:00"}'
35+
headers:
36+
Content-Length:
37+
- '141'
38+
user-agent:
39+
- scaleway-sdk-python/2.0.0
40+
method: POST
41+
uri: https://api.scaleway.com/mongodb/v1/regions/fr-par/snapshots
42+
response:
43+
body:
44+
string: '{"id": "e604d001-e413-4c55-a27c-909a852a8343", "instance_id": "dd5cd838-525b-4395-b2ae-4dec3381ceaf",
45+
"instance_name": "mgdb-magical-curie", "name": "sdk-python-test-snapshot",
46+
"status": "creating", "created_at": "2025-11-03T10:19:08.876365Z", "updated_at":
47+
"2025-11-03T10:19:08.876365Z", "expires_at": "2025-11-04T11:19:08.742558Z",
48+
"size_bytes": 0, "node_type": "mgdb-play2-nano", "volume_type": "sbs_5k",
49+
"region": "fr-par"}'
50+
headers:
51+
content-length:
52+
- '415'
53+
date:
54+
- Mon, 03 Nov 2025 10:19:09 GMT
55+
server:
56+
- Scaleway API Gateway (fr-par-3;edge01)
57+
x-request-id:
58+
- 408c3493-f594-4fc6-a6eb-f00782ea820a
59+
status:
60+
code: 200
61+
message: OK
62+
version: 1

scaleway/scaleway/mongodb/v1/tests/test_custom_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ def test_create_snapshot_with_naive_expires_at_vcr() -> None:
2020
/ "test_create_snapshot_with_naive_expires_at_vcr.cassette.yaml"
2121
)
2222
if not cassette.exists() and not os.getenv("PYTHON_UPDATE_CASSETTE"):
23-
pytest.skip("cassette not recorded yet; set PYTHON_UPDATE_CASSETTE=true to record")
23+
pytest.skip(
24+
"cassette not recorded yet; set PYTHON_UPDATE_CASSETTE=true to record"
25+
)
2426
client = initialize_client_test()
2527
api = MongodbUtilsV1API(client, bypass_validation=True)
2628

0 commit comments

Comments
 (0)