#NEWLINE# def data( TEST ) : #NEWLINE# #INDENT# TEST . images = utils . TestDataContainer ( ) #NEWLINE# TEST . snapshots = utils . TestDataContainer ( ) #NEWLINE# snapshot_dict = { #NEWLINE# #INDENT# 'name' : 'snapshot' , #NEWLINE# 'container_format' : 'ami' , #NEWLINE# 'id' : 3 , #NEWLINE# 'status' : 'active' , #NEWLINE# 'owner' : TEST . tenant . id , #NEWLINE# 'properties' : { #NEWLINE# #INDENT# 'image_type' : 'snapshot' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'is_public' : False , #NEWLINE# 'protected' : False , #NEWLINE# #UNINDENT# } #NEWLINE# snapshot_dict_no_owner = { #NEWLINE# #INDENT# 'name' : 'snapshot 2' , #NEWLINE# 'container_format' : 'ami' , #NEWLINE# 'id' : 4 , #NEWLINE# 'status' : 'active' , #NEWLINE# 'owner' : None , #NEWLINE# 'properties' : { #NEWLINE# #INDENT# 'image_type' : 'snapshot' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'is_public' : False , #NEWLINE# 'protected' : False , #NEWLINE# #UNINDENT# } #NEWLINE# snapshot_dict_queued = { #NEWLINE# #INDENT# 'name' : 'snapshot 2' , #NEWLINE# 'container_format' : 'ami' , #NEWLINE# 'id' : 5 , #NEWLINE# 'status' : 'queued' , #NEWLINE# 'owner' : TEST . tenant . id , #NEWLINE# 'properties' : { #NEWLINE# #INDENT# 'image_type' : 'snapshot' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'is_public' : False , #NEWLINE# 'protected' : False , #NEWLINE# #UNINDENT# } #NEWLINE# snapshot = images . Image ( images . ImageManager ( None ) , snapshot_dict ) #NEWLINE# TEST . snapshots . add ( snapshot ) #NEWLINE# snapshot = images . Image ( images . ImageManager ( None ) , snapshot_dict_no_owner ) #NEWLINE# TEST . snapshots . add ( snapshot ) #NEWLINE# snapshot = images . Image ( images . ImageManager ( None ) , snapshot_dict_queued ) #NEWLINE# TEST . snapshots . add ( snapshot ) #NEWLINE# image_dict = { #NEWLINE# #INDENT# 'id' : '007e7d55-fe1e-4c5c-bf08-44b4a4964822' , #NEWLINE# 'name' : 'public_image' , #NEWLINE# 'status' : 'active' , #NEWLINE# 'size' : ( 20 * ( 1024 ** 3 ) ) , #NEWLINE# 'owner' : TEST . tenant . id , #NEWLINE# 'container_format' : 'novaImage' , #NEWLINE# 'properties' : { #NEWLINE# #INDENT# 'image_type' : 'image' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'is_public' : True , #NEWLINE# 'protected' : False , #NEWLINE# #UNINDENT# } #NEWLINE# public_image = images . Image ( images . ImageManager ( None ) , image_dict ) #NEWLINE# image_dict = { #NEWLINE# #INDENT# 'id' : 'a001c047-22f8-47d0-80a1-8ec94a9524fe' , #NEWLINE# 'name' : 'private_image' , #NEWLINE# 'status' : 'active' , #NEWLINE# 'size' : ( 10 * ( 1024 ** 2 ) ) , #NEWLINE# 'owner' : TEST . tenant . id , #NEWLINE# 'container_format' : 'aki' , #NEWLINE# 'is_public' : False , #NEWLINE# 'protected' : False , #NEWLINE# #UNINDENT# } #NEWLINE# private_image = images . Image ( images . ImageManager ( None ) , image_dict ) #NEWLINE# image_dict = { #NEWLINE# #INDENT# 'id' : 'd6936c86-7fec-474a-85c5-5e467b371c3c' , #NEWLINE# 'name' : 'protected_images' , #NEWLINE# 'status' : 'active' , #NEWLINE# 'owner' : TEST . tenant . id , #NEWLINE# 'size' : ( 2 * ( 1024 ** 3 ) ) , #NEWLINE# 'container_format' : 'novaImage' , #NEWLINE# 'properties' : { #NEWLINE# #INDENT# 'image_type' : 'image' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'is_public' : True , #NEWLINE# 'protected' : True , #NEWLINE# #UNINDENT# } #NEWLINE# protected_image = images . Image ( images . ImageManager ( None ) , image_dict ) #NEWLINE# image_dict = { #NEWLINE# #INDENT# 'id' : '278905a6-4b52-4d1e-98f9-8c57bb25ba32' , #NEWLINE# 'name' : 'public_image 2' , #NEWLINE# 'status' : 'active' , #NEWLINE# 'size' : ( 5 * ( 1024 ** 3 ) ) , #NEWLINE# 'owner' : TEST . tenant . id , #NEWLINE# 'container_format' : 'novaImage' , #NEWLINE# 'properties' : { #NEWLINE# #INDENT# 'image_type' : 'image' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'is_public' : True , #NEWLINE# 'protected' : False , #NEWLINE# #UNINDENT# } #NEWLINE# public_image2 = images . Image ( images . ImageManager ( None ) , image_dict ) #NEWLINE# image_dict = { #NEWLINE# #INDENT# 'id' : '710a1acf-a3e3-41dd-a32d-5d6b6c86ea10' , #NEWLINE# 'name' : 'private_image 2' , #NEWLINE# 'status' : 'active' , #NEWLINE# 'size' : ( 30 * ( 1024 ** 3 ) ) , #NEWLINE# 'owner' : TEST . tenant . id , #NEWLINE# 'container_format' : 'aki' , #NEWLINE# 'is_public' : False , #NEWLINE# 'protected' : False , #NEWLINE# #UNINDENT# } #NEWLINE# private_image2 = images . Image ( images . ImageManager ( None ) , image_dict ) #NEWLINE# image_dict = { #NEWLINE# #INDENT# 'id' : '7cd892fd-5652-40f3-a450-547615680132' , #NEWLINE# 'name' : 'private_image 3' , #NEWLINE# 'status' : 'active' , #NEWLINE# 'size' : ( 2 * ( 1024 ** 3 ) ) , #NEWLINE# 'owner' : TEST . tenant . id , #NEWLINE# 'container_format' : 'aki' , #NEWLINE# 'is_public' : False , #NEWLINE# 'protected' : False , #NEWLINE# #UNINDENT# } #NEWLINE# private_image3 = images . Image ( images . ImageManager ( None ) , image_dict ) #NEWLINE# image_dict = { #NEWLINE# #INDENT# 'id' : 'c8756975-7a3b-4e43-b7f7-433576112849' , #NEWLINE# 'name' : 'shared_image 1' , #NEWLINE# 'status' : 'active' , #NEWLINE# 'size' : ( 8 * ( 1024 ** 3 ) ) , #NEWLINE# 'owner' : 'someothertenant' , #NEWLINE# 'container_format' : 'aki' , #NEWLINE# 'is_public' : False , #NEWLINE# 'protected' : False , #NEWLINE# #UNINDENT# } #NEWLINE# shared_image1 = images . Image ( images . ImageManager ( None ) , image_dict ) #NEWLINE# image_dict = { #NEWLINE# #INDENT# 'id' : 'f448704f-0ce5-4d34-8441-11b6581c6619' , #NEWLINE# 'name' : 'official_image 1' , #NEWLINE# 'status' : 'active' , #NEWLINE# 'size' : ( 2 * ( 1024 ** 3 ) ) , #NEWLINE# 'owner' : 'officialtenant' , #NEWLINE# 'container_format' : 'aki' , #NEWLINE# 'is_public' : True , #NEWLINE# 'protected' : False , #NEWLINE# #UNINDENT# } #NEWLINE# official_image1 = images . Image ( images . ImageManager ( None ) , image_dict ) #NEWLINE# TEST . images . add ( public_image , private_image , protected_image , public_image2 , private_image2 , private_image3 , shared_image1 , official_image1 )