.PW= ddlZddlZddlmZddlZddlZddlmZddlmZdZ dZ dd eee fd e d e d efd Z ddZdZdZejddZdS)N)Path)Union)mockcRtjdd|S)Nz [\s\r\n]+ )resubstripresults /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/mako/testing/helpers.pyflatten_resultr s" 6,V , , 2 2 4 44c hdtjdtjdd|DS)Ncfg|].}|dk|/S))r ).0xs r z result_lines..s9    7799??  ??rz\r?\nz +r)rsplitr r s r result_linesrs=  (BF5#v$>$>??   rTFfilespec make_absolute check_existsreturnct|}|r||}|r&|std||S)N)strictzNo file or directory at )rresolveexistsFileNotFoundError)rrrpaths r make_pathr"s_ >>D1||<|00GT[[]]G E8 E EFFF Krctj}|rtjt}|5|ddddS#1swxYwYdS)N) contextlib nullcontextsuppressr unlink)r! missing_okcms r _unlink_pathr*#s   ! !B4  !2 3 3  sAAAc|tj|}t|d|d|S)NT)r()exist_ok)pathlibrr*mkdir)pathspecr!s r replace_file_with_dirr0-s= < ! !D$''''JJJ Krct|d5}|ddddn #1swxYwY|S)Nwz* i am an artificial template just for you )openwrite)rfs r file_with_template_coder64s h                       Os 377c#Ktj|dzz }tjd5}||j_dVddddS#1swxYwYdS)Nizmako.codegen.time)timerpatch return_value)hoursrewound codegen_times r rewind_compile_timer?>sikkUU]+G ' ( (L)0 & sAAA)TF)F)r7)r$r-rrr9typingrunittestrrrstrboolr"r*r0r6contextmanagerr?rr rFs. 555  D#I        r