#NEWLINE# def test_image_scheme( self , mock_lbd , mock_image_meta ) : #NEWLINE# #INDENT# mock_lbd . return_value = LIST_BLOCK_DEVICES_SAMPLE #NEWLINE# drv = nailgun . Nailgun ( PROVISION_SAMPLE_DATA ) #NEWLINE# p_scheme = drv . partition_scheme #NEWLINE# i_scheme = drv . image_scheme #NEWLINE# expected_images = [ ] #NEWLINE# for fs in p_scheme . fss : #NEWLINE# #INDENT# if ( self . mount not in PROVISION_SAMPLE_DATA [ 'ks_meta' ] [ 'image_data' ] ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# i_data = PROVISION_SAMPLE_DATA [ 'ks_meta' ] [ 'image_data' ] [ fs . mount ] #NEWLINE# expected_images . append ( image . Image ( uri = i_data [ 'uri' ] , target_device = fs . device , format = i_data [ 'format' ] , container = i_data [ 'container' ] ) ) #NEWLINE# #UNINDENT# expected_images = sorted ( expected_images , key = ( lambda x : x . uri ) ) #NEWLINE# for ( i , img ) in enumerate ( sorted ( i_scheme . images , key = ( lambda x : x . uri ) ) ) : #NEWLINE# #INDENT# self . assertEqual ( img . uri , expected_images [ i ] . uri ) #NEWLINE# self . assertEqual ( img . target_device , expected_images [ i ] . target_device ) #NEWLINE# self . assertEqual ( img . format , expected_images [ i ] . format ) #NEWLINE# self . assertEqual ( img . container , expected_images [ i ] . container ) #NEWLINE# self . assertIsNone ( img . size ) #NEWLINE# self . assertIsNone ( img . md5 )