Sindbad~EG File Manager
�
&Μg�5 � �~ � d Z ddlZddlZddlZ G d� d� Zd� Zd� Zd� Zd� Zej d � � Z
d
� Zd� Zd� Z
d
� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d � Z!d!� Z"d"� Z#e$d#k( r7dd$l%m&Z& e&� ejN d% Z( e)� e( ejN d&d � yy)'z�This script contains the actual auditing tests.
It should not be imported directly, but should be run by the test_audit
module with arguments identifying each test.
� Nc �D � e Zd ZdZdefd�Zd� Zd� Zd� Ze d� � Z
d� Zy) �TestHookz�Used in standard hook tests to collect any logged events.
Should be used in a with block to ensure that it has no impact
after the test completes.
Nc �D � |xs d| _ || _ g | _ d| _ y )N� F)�raise_on_events�exc_type�seen�closed)�selfr r s �-/usr/local/lib/python3.12/test/audit-tests.py�__init__zTestHook.__init__ s$ � �.�4�"��� ��
��� ���� c �0 � t j | � | S �N)�sys�addaudithook�r �as r � __enter__zTestHook.__enter__ s � �������r c �$ � | j � y r )�closer s r �__exit__zTestHook.__exit__ s � ��
�
�r c � � d| _ y )NT)r
�r s r r zTestHook.close! s � ���r c �F � | j D �cg c] }|d �� c}S c c}w )Nr )r )r �is r �seen_eventszTestHook.seen_events$ s"