#NEWLINE# def test_read_stored_checksum_legacy_essex( self ) : #NEWLINE# #INDENT# with utils . tempdir ( ) as tmpdir : #NEWLINE# #INDENT# self . flags ( instances_path = tmpdir ) #NEWLINE# self . flags ( image_info_filename_pattern = '$instances_path/%(image)s.info' , group = 'libvirt' ) #NEWLINE# fname = os . path . join ( tmpdir , 'aaa' ) #NEWLINE# old_fname = ( fname + '.sha1' ) #NEWLINE# f = open ( old_fname , 'w' ) #NEWLINE# f . write ( 'fdghkfhkgjjksfdgjksjkghsdf' ) #NEWLINE# f . close ( ) #NEWLINE# csum_output = imagecache . read_stored_checksum ( fname , timestamped = False ) #NEWLINE# self . assertEqual ( csum_output , 'fdghkfhkgjjksfdgjksjkghsdf' ) #NEWLINE# self . assertFalse ( os . path . exists ( old_fname ) ) #NEWLINE# info_fname = imagecache . get_info_filename ( fname ) #NEWLINE# self . assertTrue ( os . path . exists ( info_fname ) )