File: //lib/python3/dist-packages/samba/tests/samba_tool/__pycache__/help.cpython-310.pyc
o
�/a1 � @ sL d dl Z d dlmZ d dlmZ d dlmZ d dlmZ G dd� de�ZdS )� N)�SambaToolCmdTest)�BlackboxProcessError)�check_help_consistency)�
get_stringc @ s e Zd ZdZdd� Zdd� ZdS )�HelpTestCasezVTests for samba-tool help and --help
We test for consistency and lack of crashes.c C s | j |� d S )N)�runcmd)�self�args� r
�=/usr/lib/python3/dist-packages/samba/tests/samba_tool/help.py�_find_sub_commands s zHelpTestCase._find_sub_commandsc C sn g g}g }t d�D ]�}g }|D ]�}d�dg| dg �}z| �|�}W n ty= } z|j}|�|� W Y d }~nd }~ww t|�}|�d�d } t� d| tj
�}
|
D ]
}|�||g � qSd�ddg| �}z| �|�}W n ty� } z|j}|�|� W Y d }~nd }~ww t|�}| �||� t|d dd
�}
|
d ur�| �
d||
f � q|s� n|}q | �|g � d S )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
r r s r ) r �samba.tests.samba_tool.baser �samba.testsr r �samba.commonr r r
r
r
r �<module> s