#NEWLINE# def test_patch_from_str( self ) : #NEWLINE# #INDENT# file_content = '\nfrom conans import ConanFile\nfrom conans.tools import patch\nimport os\n\nclass ConanFileToolsTest(ConanFile):\n    name = "test"\n    version = "1.9.10"\n    settings = []\n\n    def source(self):\n        pass\n\n    def build(self):\n        patch_content = \'\'\'--- text.txt\t2016-01-25 17:57:11.452848309 +0100\n+++ text_new.txt\t2016-01-25 17:57:28.839869950 +0100\n@@ -1 +1 @@\n-ONE TWO THREE\n+ONE TWO DOH!\'\'\'\n        patch(patch_string=patch_content)\n\n' #NEWLINE# tmp_dir = temp_folder ( ) #NEWLINE# file_path = os . path . join ( tmp_dir , 'conanfile.py' ) #NEWLINE# text_file = os . path . join ( tmp_dir , 'text.txt' ) #NEWLINE# save ( file_path , file_content ) #NEWLINE# save ( text_file , 'ONE TWO THREE' ) #NEWLINE# loader = ConanFileLoader ( None , Settings ( ) , OptionsValues . loads ( '' ) ) #NEWLINE# ret = loader . load_conan ( file_path , None ) #NEWLINE# curdir = os . path . abspath ( os . curdir ) #NEWLINE# os . chdir ( tmp_dir ) #NEWLINE# try : #NEWLINE# #INDENT# ret . build ( ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# os . chdir ( curdir ) #NEWLINE# #UNINDENT# content = load ( file_content ) #NEWLINE# self . assertEquals ( content , 'ONE TWO DOH!' )