#NEWLINE# def test_1_valid_md5( self ) : #NEWLINE# #INDENT# "Test 'update' command's ability to get a file from a URL\n        and verify valid MD5\n        " #NEWLINE# test_file = os . path . abspath ( __file__ ) #NEWLINE# f = file ( test_file , 'rb' ) #NEWLINE# m = hashlib . md5 ( ) #NEWLINE# while True : #NEWLINE# #INDENT# file_data = f . read ( 8096 ) #NEWLINE# if ( not file_data ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# m . update ( file_data ) #NEWLINE# #UNINDENT# f . close ( ) #NEWLINE# md5sum = m . hexdigest ( ) #NEWLINE# url = ( 'file://' + test_file ) #NEWLINE# local_file = self . update_inst . _get_to_local_file ( url , md5sum ) #NEWLINE# f = file ( local_file ) #NEWLINE# m = hashlib . md5 ( ) #NEWLINE# while True : #NEWLINE# #INDENT# file_data = f . read ( 8096 ) #NEWLINE# if ( not file_data ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# m . update ( file_data ) #NEWLINE# #UNINDENT# f . close ( ) #NEWLINE# os . unlink ( local_file ) #NEWLINE# self . assertEqual ( md5sum , m . hexdigest ( ) )