File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -282,12 +282,43 @@ def test_upload_download() -> None:
282
282
ubuntu_instance .stop ()
283
283
284
284
285
+ def test_beta_vm_management () -> None :
286
+ _check_api_key ()
287
+ client = Scrapybara ()
288
+
289
+ # Start an rodent instance
290
+ instance = client .start_ubuntu (backend = "rodent" )
291
+ assert instance .id is not None
292
+
293
+ try :
294
+ # Take a snapshot
295
+ snapshot_response = client .beta_vm_management .take_snapshot (instance_id = instance .id )
296
+ assert snapshot_response is not None
297
+ assert snapshot_response .snapshot_id is not None
298
+ snapshot_id = snapshot_response .snapshot_id
299
+ print (f"Created snapshot with ID: { snapshot_id } " )
300
+
301
+ # Warmup the snapshot
302
+ warmup_response = client .beta_vm_management .warmup_snapshot (snapshot_id = snapshot_id )
303
+ assert warmup_response is not None
304
+ assert warmup_response .success is True
305
+
306
+ # Delete the snapshot
307
+ delete_response = client .beta_vm_management .delete_snapshot (snapshot_id = snapshot_id )
308
+ assert delete_response is not None
309
+ assert delete_response .success is True
310
+
311
+ finally :
312
+ instance .stop ()
313
+
314
+
285
315
if __name__ == "__main__" :
286
316
test_ubuntu ()
287
317
test_browser ()
288
318
test_ubuntu_openai ()
289
319
test_browser_openai ()
290
320
test_upload_download ()
321
+ test_beta_vm_management ()
291
322
# test_ubuntu_thinking()
292
323
# test_browser_thinking()
293
324
# test_windows()
You can’t perform that action at this time.
0 commit comments