@@ -443,6 +443,17 @@ 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 = (
448+ {
449+ "deleted" : True ,
450+ "id" : "img_123" ,
451+ "imageName" : "custom_node" ,
452+ "uploaded" : True ,
453+ }
454+ if method == "DELETE"
455+ else IMAGE_LIST_PAYLOAD
456+ )
446457 elif url .endswith ("/images" ):
447458 payload = IMAGE_LIST_PAYLOAD
448459 elif url .endswith ("/snapshots" ):
@@ -645,6 +656,17 @@ async def request(self, method, url, params=None, json=None):
645656 )
646657 elif "/images/builds/" in url :
647658 payload = IMAGE_BUILD_PAYLOAD
659+ elif "/images/" in url :
660+ payload = (
661+ {
662+ "deleted" : True ,
663+ "id" : "img_123" ,
664+ "imageName" : "custom_node" ,
665+ "uploaded" : True ,
666+ }
667+ if method == "DELETE"
668+ else IMAGE_LIST_PAYLOAD
669+ )
648670 elif url .endswith ("/images" ):
649671 payload = IMAGE_LIST_PAYLOAD
650672 elif url .endswith ("/snapshots" ):
@@ -1004,8 +1026,9 @@ def test_sync_sandbox_snapshot_and_image_build_list_contract(use_legacy_model):
10041026 builds = manager .list_image_builds (params )
10051027 snapshot = manager .get_snapshot ("snapshot-1" )
10061028 deleted = manager .delete_snapshot ("snapshot-1" )
1029+ deleted_image = manager .delete_image ("custom_node" )
10071030
1008- list_call , get_call , delete_call = client .transport .client .calls
1031+ list_call , get_call , delete_call , delete_image_call = client .transport .client .calls
10091032 assert list_call == {
10101033 "method" : "GET" ,
10111034 "url" : "https://api.example.com/images/builds" ,
@@ -1024,6 +1047,12 @@ def test_sync_sandbox_snapshot_and_image_build_list_contract(use_legacy_model):
10241047 assert delete_call ["method" ] == "DELETE"
10251048 assert delete_call ["url" ].endswith ("/snapshots/snapshot-1" )
10261049 assert deleted .deleted is True
1050+ assert delete_image_call ["method" ] == "DELETE"
1051+ assert delete_image_call ["url" ].endswith ("/images/custom_node" )
1052+ assert deleted_image .deleted is True
1053+ assert deleted_image .id == "img_123"
1054+ assert deleted_image .image_name == "custom_node"
1055+ assert deleted_image .uploaded is True
10271056
10281057
10291058@pytest .mark .parametrize (
@@ -1637,8 +1666,9 @@ async def test_async_sandbox_snapshot_and_image_build_list_contract(
16371666 builds = await manager .list_image_builds (params )
16381667 snapshot = await manager .get_snapshot ("snapshot-1" )
16391668 deleted = await manager .delete_snapshot ("snapshot-1" )
1669+ deleted_image = await manager .delete_image ("custom_node" )
16401670
1641- list_call , get_call , delete_call = client .transport .client .calls
1671+ list_call , get_call , delete_call , delete_image_call = client .transport .client .calls
16421672 assert list_call == {
16431673 "method" : "GET" ,
16441674 "url" : "https://api.example.com/images/builds" ,
@@ -1657,6 +1687,12 @@ async def test_async_sandbox_snapshot_and_image_build_list_contract(
16571687 assert delete_call ["method" ] == "DELETE"
16581688 assert delete_call ["url" ].endswith ("/snapshots/snapshot-1" )
16591689 assert deleted .deleted is True
1690+ assert delete_image_call ["method" ] == "DELETE"
1691+ assert delete_image_call ["url" ].endswith ("/images/custom_node" )
1692+ assert deleted_image .deleted is True
1693+ assert deleted_image .id == "img_123"
1694+ assert deleted_image .image_name == "custom_node"
1695+ assert deleted_image .uploaded is True
16601696
16611697
16621698@pytest .mark .anyio
0 commit comments