#NEWLINE# def test_read_stored_checksum( 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# csum_input = '{"sha1": "fdghkfhkgjjksfdgjksjkghsdf"}\n' #NEWLINE# fname = os . path . join ( tmpdir , 'aaa' ) #NEWLINE# info_fname = imagecache . get_info_filename ( fname ) #NEWLINE# f = open ( info_fname , 'w' ) #NEWLINE# f . write ( csum_input ) #NEWLINE# f . close ( ) #NEWLINE# csum_output = imagecache . read_stored_checksum ( fname , timestamped = False ) #NEWLINE# self . assertEqual ( csum_input . rstrip ( ) , ( '{"sha1": "%s"}' % fname ) )