§ |<ˆj”ãó—dZddlmZddlZddlZddlZddlZddlZddlm Z ddl m Z m Z ddl mZddlmZddlmZe Ze eefZes"d „ejeejd ¦«¦«<d#d„ZdZdZd$d„Zd%d„Zd&d„Zefd'd"„Z dS)(z,Utility functions for configuration testing.é)Ú annotationsN)ÚPath)ÚAnyÚDict)ÚMock)Ú PY38_PLUS)ÚRuncó—|S)N©)ÚrÚ_s úu/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/pylint/testutils/configuration_test.pyúrs€À€óÚÚtested_configuration_fileú str | PathÚsuffixÚstrÚdefaultÚreturncóJ—|}t|¦«}|j|j›d|›�z }| ¦«rSt |d¬¦«5}| ¦«}ddd¦«n #1swxYwYt jd|¦«nt jd||¦«|S)zKReturn the expected value from the file if it exists, or the given default.ú.Úutf8)ÚencodingNz %s exists.z%s not found, using '%s'.)rÚparentÚstemÚexistsÚopenÚreadÚloggingÚinfo)rrrÚexpectedÚpathÚexpected_result_pathÚfs rÚget_expected_or_defaultr'"sï€ð €HÝ Ð)Ñ *Ô *€DØœ;¨D¬IÐ)@Ð)@¸Ð)@Ð)@Ñ@ÐØ×"Ò"Ñ$Ô$ðQÝ Ð&°Ð 8Ñ 8Ô 8ð ¸AØ—v’v‘x”xˆHð ð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð õ Œ �\Ð#7Ñ8Ô8Ð8Ð8åŒ Ð0Ð2FÈÑPÔPÐPØ €OsÁ A,Á,A0Á3A0Úfunctional_appendÚfunctional_removeÚconfiguration_pathÚdefault_configurationÚPylintConfigurationcóÆ—tj|¦«}t|dd¬¦«}tj|¦«}| ¦«D]‘\}}|t kr+| ¦«D]\}}||xx|z cc<ŒŒ;|tkrF| ¦«D]0\}}g} ||D]} | |vr|  | ¦«Œ| ||<Œ1ŒŒ|||<Œ’|S)zIGet the expected parsed configuration of a configuration functional test.z result.jsonz{}©rr) ÚcopyÚdeepcopyr'ÚjsonÚloadsÚitemsÚEXPECTED_CONF_APPEND_KEYÚEXPECTED_CONF_REMOVE_KEYÚappend) r*r+ÚresultÚconfig_as_jsonÚ to_overrideÚkeyÚvalueÚfkeyÚfvalueÚ new_valueÚ old_values rÚget_expected_configurationr@;s$€õŒ]Ð0Ñ 1Ô 1€FÝ,Ø =¸$ðñô€Nõ”*˜^Ñ,Ô,€KØ!×'Ò'Ñ)Ô)ð  ð  ‰ ˆˆUØ Õ*Ò *Ð *Ø %§ ¢ ¡ ¤ ð 'ð '‘ ��fØ�t� � ”  Ñ&� � ‘ � ð 'à Õ,Ò ,Ð ,Ø %§ ¢ ¡ ¤ ð )ð )‘ ��fØ� Ø!'¨¤ð4ð4�IØ ¨Ð.Ð.Ø!×(Ò(¨Ñ3Ô3Ð3øØ(��t‘ � ð  )ð ˆF�3‰KˆKØ €MrÚ suffix_filterú list[Path]cóp‡‡—t|¦«Šˆˆfd„‰j ¦«D¦«S)zEReturn all the file related to a test conf file ending with a suffix.có°•—g|]R}t|j¦« ‰j¦«¯.t|¦« ‰¦«¯P|‘ŒSSr )rrÚ startswithÚendswith)Ú.0ÚpÚ conf_pathrAs €€rú z%get_related_files..Yscø€ð ð ð à Ý ˆqŒv‰;Œ;× !Ò ! )¤.Ñ 1Ô 1ð õ7:¸!±f´f·o²oÀmÑ6TÔ6Tð Ø ð ð ð r)rrÚiterdir)rrArIs `@rÚget_related_filesrLTsSøø€õÐ.Ñ/Ô/€Ið ð ð ð ð àÔ!×)Ò)Ñ+Ô+ð ñ ô ðrÚuser_specific_pathrútuple[int, str]cód—d}d}t|d¬¦«}t|¦«dkrtjd||¦«dS|stjd¦«d S|d} t t |j¦« d d¬ ¦«d ¦«}n/#t$r"}tjd |||¦«Yd}~dSd}~wwxYwt||›d�d¬¦«}tjd||¦«||  |t|¦«  |¦«¬¦«fS)z-Get the expected output of a functional test.rz—we expect a single file of the form 'filename.32.out' where 'filename' represents the name of the configuration file, and '32' the expected error code.Úout)rAézToo much .out files for %s %s.)éÿÿÿÿzout file is brokenz9.out file does not exists, so the expected exit code is 0)rrr)ÚmaxsplitrRz-Wrong format for .out file name for %s %s: %sNz.outrr.z4Output exists for %s so the expected exit code is %s)ÚabspathÚrelpath)rLÚlenr!Úerrorr"ÚintrrÚrsplitÚ Exceptionr'ÚformatrÚ relative_to)r*rMÚ exit_codeÚmsgÚpossible_out_filesr$ÚeÚoutputs rÚget_expected_outputrb`s›€ð€Ið Pðõ+Ð+=ÈUÐSÑSÔSÐÝ Ð ÑÔ Ò"Ð"ÝŒ Ø ,Ø Ø ñ ô ð ð (Ð'Ø ðõ Œ ÐPÑQÔQÐQ؈uØ ˜aÔ €Dð (Ý�˜DœI™œ×-Ò-¨c¸AÐ-Ñ>Ô>¸rÔBÑCÔCˆ ˆ øÝ ð(ð(ð(ÝŒ Ø ;Ø Ø Ø ñ  ô ð ð (Ð'Ð'Ð'Ð'Ð'øøøøð(øøøõ%Ø iÐ#5Ð#5Ð#5¸rðñô€Fõ „LØ>ØØñôðð �f—m’mØ"ÝÐ'Ñ(Ô(×4Ò4Ð5GÑHÔHð$ñôð ðsÁ"r}s~ðð 3Ð2à"Ð"Ð"Ð"Ð"Ð"à € € € Ø € € € Ø€€€Ø € € € Ø€€€ØÐÐÐÐÐØÐÐÐÐÐÐÐØÐÐÐÐÐà&Ð&Ð&Ð&Ð&Ð&ØÐÐÐÐÐðÐØ˜3Ð 2Ð2Ô3ÐððCð5C°N€DÔ˜D˜D  ¤¨B¡¤Ñ0Ô0Ñ1ððððð*/ÐØ.Ðððððð2 ð ð ð ð.ð.ð.ð.ðd9Að6ð6ð6ð6ð6ð6ð6r