#NEWLINE# @ classmethod #NEWLINE# def _getUrlForTestFile( cls , size = None ) : #NEWLINE# #INDENT# fileName = ( 'testfile_%s' % uuid . uuid4 ( ) ) #NEWLINE# dirPath = cls . _externalStore ( ) #NEWLINE# localFilePath = ( dirPath + fileName ) #NEWLINE# url = ( 'file://%s' % localFilePath ) #NEWLINE# if ( size is None ) : #NEWLINE# #INDENT# return url #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# content = os . urandom ( size ) #NEWLINE# with open ( localFilePath , 'w' ) as writable : #NEWLINE# #INDENT# writable . write ( content ) #NEWLINE# #UNINDENT# return ( url , hashlib . md5 ( content ) . hexdigest ( ) )