#NEWLINE# @ mock . patch . object ( image_service . HttpImageService , 'show' , autospec = True ) #NEWLINE# def test_validate_image_properties_nonglance_image( self , image_service_show_mock ) : #NEWLINE# #INDENT# instance_info = { #NEWLINE# #INDENT# 'image_source' : 'http://ubuntu' , #NEWLINE# 'kernel' : 'kernel_uuid' , #NEWLINE# 'ramdisk' : 'file://initrd' , #NEWLINE# 'root_gb' : 100 , #NEWLINE# #UNINDENT# } #NEWLINE# image_service_show_mock . return_value = { #NEWLINE# #INDENT# 'size' : 1 , #NEWLINE# 'properties' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# node = obj_utils . create_test_node ( self . context , driver = 'fake_pxe' , instance_info = instance_info , driver_info = DRV_INFO_DICT , driver_internal_info = DRV_INTERNAL_INFO_DICT ) #NEWLINE# inst_info = utils . get_image_instance_info ( node ) #NEWLINE# utils . validate_image_properties ( self . context , inst_info , [ 'kernel' , 'ramdisk' ] ) #NEWLINE# image_service_show_mock . assert_called_once_with ( mock . ANY , instance_info [ 'image_source' ] )