#NEWLINE# def test_is_valid_info_file( self ) : #NEWLINE# #INDENT# hashed = 'e97222e91fc4241f49a7f520d1dcf446751129b3' #NEWLINE# self . flags ( instances_path = '/tmp/no/such/dir/name/please' ) #NEWLINE# self . flags ( image_info_filename_pattern = '$instances_path/_base/%(image)s.info' , group = 'libvirt' ) #NEWLINE# base_filename = os . path . join ( CONF . instances_path , '_base' , hashed ) #NEWLINE# is_valid_info_file = imagecache . is_valid_info_file #NEWLINE# self . assertFalse ( is_valid_info_file ( 'banana' ) ) #NEWLINE# self . assertFalse ( is_valid_info_file ( os . path . join ( CONF . instances_path , '_base' , '00000001' ) ) ) #NEWLINE# self . assertFalse ( is_valid_info_file ( base_filename ) ) #NEWLINE# self . assertFalse ( is_valid_info_file ( ( is_valid_info_file + '.sha1' ) ) ) #NEWLINE# self . assertTrue ( is_valid_info_file ( ( base_filename + '.info' ) ) )