§
    ÷yIfL  ã                  ól   — d dl mZ d dlZd dlmZ d dlmZ d dlmZ dZ		 h d£Z
	 h d£Z	 e	fdd„Zdd„ZdS )é    )ÚannotationsN)ÚIterator)ÚPath)ÚFunctionalTestFileé1   >   ÚextÚ
regressionÚregression_02Údeprecated_relative_import>   r   Ú	docparamsr   Ú	input_dirú
Path | strÚmax_file_per_directoryÚintÚreturnúlist[FunctionalTestFile]c                ó|  — g }t          t          | ¦  «        |¦  «         t          j        | ¦  «        D ]‡\  }}}|                     d¦  «        rŒ|                     ¦   «          |                     ¦   «          |D ]@}|dk    r8|                     d¦  «        r#|                     t          ||¦  «        ¦  «         ŒAŒˆ|S )z*Get all functional tests in the input_dir.Ú__pycache__z__init__.pyú.py)Ú!_check_functional_tests_structurer   ÚosÚwalkÚendswithÚsortÚappendr   )r   r   ÚsuiteÚdirpathÚdirnamesÚ	filenamesÚfilenames          úe/var/www/piapp/venv/lib/python3.11/site-packages/pylint/testutils/functional/find_functional_tests.pyÚ(get_functional_test_files_from_directoryr"   #   sÒ   € ð
 €Eå%¥d¨9¡o¤oÐ7MÑNÔNÐNå(*¬°	Ñ(:Ô(:ð Dð DÑ$ˆ�˜9Ø×Ò˜MÑ*Ô*ð 	ØØ�Š‰ŒˆØ�ŠÑÔÐØ!ð 	Dð 	DˆHØ˜=Ò(Ð(¨X×->Ò->¸uÑ-EÔ-EÐ(Ø—’Õ/°¸ÑBÔBÑCÔCÐCøð	Dð €Ló    Ú	directoryr   ÚNonec                ó2  ‡‡
‡— t          | ¦  «        j                             d¦  «        rdS t          ¦   «         }t          ¦   «         }dˆfd	„Š
dˆ
ˆˆfd„Š ‰| ¦  «        D ]L}|                     ¦   «         r|                     |¦  «         Œ,|j        dk    r|                     |¦  «         ŒMg }g }|D ]Ö}|j        |j                             d¦  «        d         z  }| 	                    ¦   «         r| 
                    ||f¦  «         t          |j        j        ¦  «        dk    sd|j        j        t          vrQ|j        j        j        t          vr9|j                             |j        j        ¦  «        s| 
                    |¦  «         Œ×|s|r‡d}	|D ]:\  }}|	d| › d|                     | ¦  «        › d|                     | ¦  «        › d�z  }	Œ;|D ]6}|	d| › d|                     | ¦  «        › d|j        › d|j        j        › d�	z  }	Œ7t          |	¦  «        ‚dS )zrCheck if test directories follow correct file/folder structure.

    Ignore underscored directories or files.
    Ú_NÚpathr   Ú
violationsúlist[tuple[Path, int]]r   ú
list[Path]c                óÌ   •— t          d„ |                      ¦   «         D ¦   «         ¦  «        }t          |¦  «        ‰k    r$|                     | t          |¦  «        f¦  «         |S )zEReturn directories and files from a directory and handles violations.c              3  óN   K  — | ] }|j                              d ¦  «        °|V — Œ!dS )r'   N)ÚstemÚ
startswith)Ú.0Úps     r!   ú	<genexpr>zQ_check_functional_tests_structure.<locals>._get_files_from_dir.<locals>.<genexpr>H   sK   è è € ð 0
ð 0
Ø¨Q¬V×->Ò->¸sÑ-CÔ-Cð0
Øð0
ð 0
ð 0
ð 0
ð 0
ð 0
r#   )ÚlistÚiterdirÚlenr   )r(   r)   Ú files_without_leading_underscorer   s      €r!   Ú_get_files_from_dirz>_check_functional_tests_structure.<locals>._get_files_from_dirD   sx   ø€ õ ,0ð 0
ð 0
Ø—|’|‘~”~ð0
ñ 0
ô 0
ñ ,
ô ,
Ð(õ Ð/Ñ0Ô0Ð3IÒIÐIØ×Ò˜t¥SÐ)IÑ%JÔ%JÐKÑLÔLÐLØ/Ð/r#   úIterator[Path]c           	   3  ó  •K  — g }t          ¦   «         } ‰| |¦  «        }d}|D ]®}|                     ¦   «         r‚ ‰||¦  «        }|                     ¦   «         V — 	  ‰|¦  «        E d {V —† ŒK# t          $ r@}|                     t          |¦  «                             |d¦  «        ¦  «         Y d }~Œ�d }~ww xY w|                     ¦   «         V — Œ¯|s|r2|}|D ]\  }	}
|d|	› d|
› d‰› d�z  }Œ|D ]}||z  }Œt          |¦  «        ‚d S )NzBThe following directory contains too many functional tests files:
Ú z- z: z when the max is ú
)ÚsetÚis_dirÚresolveÚAssertionErrorÚaddÚstrÚreplace)r(   r)   Úviolations_msgsÚparent_dir_filesÚ	error_msgÚ_file_or_dirÚ_filesÚeÚ_msgÚoffending_fileÚnumberr7   r   r   s              €€€r!   r   z/_check_functional_tests_structure.<locals>.walkO   s§  øè è € Ø-/ˆ
Ý$'¡E¤EˆØ.Ð.¨t°ZÑ@Ô@ÐàQð 	ð -ð 		-ð 		-ˆLØ×"Ò"Ñ$Ô$ð -Ø,Ð,¨\¸:ÑFÔF�Ø"×*Ò*Ñ,Ô,Ð,Ð,Ð,ðGØ#˜t LÑ1Ô1Ð1Ð1Ð1Ð1Ð1Ð1Ð1Ð1øÝ%ð Gð Gð GØ#×'Ò'­¨A©¬¯ª°yÀ"Ñ(EÔ(EÑFÔFÐFÐFÐFÐFÐFÐFøøøøðGøøøð #×*Ò*Ñ,Ô,Ð,Ð,Ð,Ð,Øð 	'˜ð 	'ØˆDØ*4ð cð cÑ&� ØÐb˜^ÐbÐb¨vÐbÐbÐH^ÐbÐbÐbÑb��Ø,ð "ð "�	Ø˜	Ñ!��Ý  Ñ&Ô&Ð&ð	'ð 	's   ÁA/Á/
B9Á96B4Â4B9r   r   é   z1The following functional tests are disorganized:
z- In 'z', 'z' should go in 'z'
z', zA should go in a directory that starts with the first letters of 'z' (not 'z')
)r(   r   r)   r*   r   r+   )r(   r   r   r8   )r   r.   r/   r<   r=   r@   ÚsuffixÚparentÚsplitÚexistsr   r5   ÚIGNORED_PARENT_DIRSÚIGNORED_PARENT_PARENT_DIRSÚrelative_tor?   )r$   r   ÚfilesÚdirsÚfile_or_dirÚdirectory_does_not_existsÚmisplaced_fileÚfileÚpossible_dirÚmsgr7   r   s    `        @@r!   r   r   7   s×  øøø€ õ ˆI�„Ô×&Ò& sÑ+Ô+ð Øˆå‘u”u€EÝ‘e”e€Dð	0ð 	0ð 	0ð 	0ð 	0ð 	0ð'ð 'ð 'ð 'ð 'ð 'ð 'ð 'ð4 �t˜I‘”ð #ð #ˆØ×ÒÑÔð 	#Ø�HŠH�[Ñ!Ô!Ð!Ð!ØÔ 5Ò(Ð(Ø�IŠI�kÑ"Ô"Ð"øà9;ÐØ!#€NØð ,ð ,ˆØ”{ T¤Y§_¢_°SÑ%9Ô%9¸!Ô%<Ñ<ˆØ×ÒÑ Ô ð 	CØ%×,Ò,¨d°LÐ-AÑBÔBÐBõ �D”KÔ$Ñ%Ô%¨Ò*Ð*Ø”Ô Õ(;Ð;Ð;Ø”Ô"Ô'Õ/IÐIÐIà”9×'Ò'¨¬Ô(8Ñ9Ô9ð ,Ø×%Ò% dÑ+Ô+Ð+øà ð " Nð "ØBˆØ";ð 	ð 	ÑˆD�,ØðJ˜ð Jð J¨×(8Ò(8¸Ñ(CÔ(Cð Jð JØ!-×!9Ò!9¸)Ñ!DÔ!DðJð Jð JñˆCˆCð #ð 	ð 	ˆDØðB˜ð Bð B t×'7Ò'7¸	Ñ'BÔ'Bð Bð Bàœ	ðBð Bà+/¬;Ô+;ðBð Bð BñˆCˆCõ
 ˜SÑ!Ô!Ð!ð"ð "r#   )r   r   r   r   r   r   )r$   r   r   r   r   r%   )Ú
__future__r   r   Úcollections.abcr   Úpathlibr   Ú%pylint.testutils.functional.test_filer   Ú!REASONABLY_DISPLAYABLE_VERTICALLYrQ   rR   r"   r   © r#   r!   ú<module>rb      sÕ   ðð
 #Ð "Ð "Ð "Ð "Ð "à 	€	€	€	Ø $Ð $Ð $Ð $Ð $Ð $Ø Ð Ð Ð Ð Ð à DÐ DÐ DÐ DÐ DÐ Dà$&Ð !ðð
ð ð Ð ð 8ðð ð Ð ð
 Cð
 #Dðð ð ð ð ð(T"ð T"ð T"ð T"ð T"ð T"r#   