HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/samba/tests/samba_tool/__pycache__/help.cpython-310.pyc
o

�/a1�@sLddlZddlmZddlmZddlmZddlmZGdd�de�ZdS)�N)�SambaToolCmdTest)�BlackboxProcessError)�check_help_consistency)�
get_stringc@s eZdZdZdd�Zdd�ZdS)�HelpTestCasezVTests for samba-tool help and --help

    We test for consistency and lack of crashes.cCs|j|�dS)N)�runcmd)�self�args�r
�=/usr/lib/python3/dist-packages/samba/tests/samba_tool/help.py�_find_sub_commands szHelpTestCase._find_sub_commandscCsngg}g}td�D]�}g}|D]�}d�dg|dg�}z|�|�}Wnty=}z|j}|�|�WYd}~nd}~wwt|�}|�d�d}	t�	d|	tj
�}
|
D]
}|�||g�qSd�ddg|�}z|�|�}Wnty�}z|j}|�|�WYd}~nd}~wwt|�}|�||�t|d	dd
�}
|
dur�|�
d||
f�q|s�n|}q	|�|g�dS)N�� z
samba-toolz--helpzAvailable subcommands:�z^\s*([\w-]+)\s+-�helpzOptions:)�
options_start�options_endzconsistency error with %s:
%s)�range�join�check_outputr�stdout�appendr�	partition�re�findall�	MULTILINE�assertEqualr�fail)r�known_commands�failed_commands�i�new_commands�c�line�output�e�tail�subcommands�s�output2�errr
r
r�test_help_tree#sR�������zHelpTestCase.test_help_treeN)�__name__�
__module__�__qualname__�__doc__rr+r
r
r
rrsr)	r�samba.tests.samba_tool.baser�samba.testsrr�samba.commonrrr
r
r
r�<module>s