@@ -443,6 +443,8 @@ def request(self, method, url, params=None, json=None):
443443 )
444444 elif "/images/builds/" in url :
445445 payload = IMAGE_BUILD_PAYLOAD
446+ elif "/images/" in url :
447+ payload = {"deleted" : True } if method == "DELETE" else IMAGE_LIST_PAYLOAD
446448 elif url .endswith ("/images" ):
447449 payload = IMAGE_LIST_PAYLOAD
448450 elif url .endswith ("/snapshots" ):
@@ -645,6 +647,8 @@ async def request(self, method, url, params=None, json=None):
645647 )
646648 elif "/images/builds/" in url :
647649 payload = IMAGE_BUILD_PAYLOAD
650+ elif "/images/" in url :
651+ payload = {"deleted" : True } if method == "DELETE" else IMAGE_LIST_PAYLOAD
648652 elif url .endswith ("/images" ):
649653 payload = IMAGE_LIST_PAYLOAD
650654 elif url .endswith ("/snapshots" ):
@@ -1004,8 +1008,9 @@ def test_sync_sandbox_snapshot_and_image_build_list_contract(use_legacy_model):
10041008 builds = manager .list_image_builds (params )
10051009 snapshot = manager .get_snapshot ("snapshot-1" )
10061010 deleted = manager .delete_snapshot ("snapshot-1" )
1011+ deleted_image = manager .delete_image ("custom_node" )
10071012
1008- list_call , get_call , delete_call = client .transport .client .calls
1013+ list_call , get_call , delete_call , delete_image_call = client .transport .client .calls
10091014 assert list_call == {
10101015 "method" : "GET" ,
10111016 "url" : "https://api.example.com/images/builds" ,
@@ -1024,6 +1029,9 @@ def test_sync_sandbox_snapshot_and_image_build_list_contract(use_legacy_model):
10241029 assert delete_call ["method" ] == "DELETE"
10251030 assert delete_call ["url" ].endswith ("/snapshots/snapshot-1" )
10261031 assert deleted .deleted is True
1032+ assert delete_image_call ["method" ] == "DELETE"
1033+ assert delete_image_call ["url" ].endswith ("/images/custom_node" )
1034+ assert deleted_image .deleted is True
10271035
10281036
10291037@pytest .mark .parametrize (
@@ -1637,8 +1645,9 @@ async def test_async_sandbox_snapshot_and_image_build_list_contract(
16371645 builds = await manager .list_image_builds (params )
16381646 snapshot = await manager .get_snapshot ("snapshot-1" )
16391647 deleted = await manager .delete_snapshot ("snapshot-1" )
1648+ deleted_image = await manager .delete_image ("custom_node" )
16401649
1641- list_call , get_call , delete_call = client .transport .client .calls
1650+ list_call , get_call , delete_call , delete_image_call = client .transport .client .calls
16421651 assert list_call == {
16431652 "method" : "GET" ,
16441653 "url" : "https://api.example.com/images/builds" ,
@@ -1657,6 +1666,9 @@ async def test_async_sandbox_snapshot_and_image_build_list_contract(
16571666 assert delete_call ["method" ] == "DELETE"
16581667 assert delete_call ["url" ].endswith ("/snapshots/snapshot-1" )
16591668 assert deleted .deleted is True
1669+ assert delete_image_call ["method" ] == "DELETE"
1670+ assert delete_image_call ["url" ].endswith ("/images/custom_node" )
1671+ assert deleted_image .deleted is True
16601672
16611673
16621674@pytest .mark .anyio
0 commit comments