Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_syslog.cpython-312.pyc

�

'Μg�����ddlmZmZejd�ZddlmZddlZddlZddl	Z	ddl
Z
ddlmZGd�de
j�Zedk(re
j �yy)	�)�
import_helper�threading_helper�syslog)�supportN)�dedentc�|�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
ej�d	��Z
d
�Zd�Zd�Zy
)�Testc�,�tj�y�N)r�closelog��selfs �-/usr/local/lib/python3.12/test/test_syslog.py�tearDownz
Test.tearDowns������c�x�tjd�|jttjd�y)N�pythonu�)r�openlog�assertRaises�UnicodeEncodeErrorr
s r�test_openlogzTest.test_openlogs%�����x� ����,�f�n�n�h�Grc��tjd�tjd�tjtjd�y)Nr�$test message from python test_syslog�"test error from python test_syslog)rr�LOG_ERRr
s r�test_syslogzTest.test_syslogs.�����x� ��
�
�<�=��
�
�f�n�n�&J�Krc��tj�tjd�tjtjd�y)Nrr)rrrr
s r�test_syslog_implicit_openzTest.test_syslog_implicit_opens,�������
�
�<�=��
�
�f�n�n�&J�Krc�~�tjd�tj�tj�y)Nr)rrrr
s r�
test_closelogzTest.test_closelog"s"�����x� ��������rc��tjtj�}tj|�}|j	tjd�|�|j	tj|�|�y)Nr)r�LOG_UPTO�LOG_WARNING�
setlogmask�assertEqual)r�mask�oldmasks   r�test_setlogmaskzTest.test_setlogmask's\�����v�1�1�2���#�#�D�)������*�*�1�-�t�4�����*�*�7�3�T�:rc��tjtj�}|j|tj	tj�z�|j|tj	tj
�z�|j
|tj	tj�z�yr)rr"r#�
assertTrue�LOG_MASKr�assertFalse�LOG_INFO)rr&s  r�
test_log_maskzTest.test_log_mask-st�����v�1�1�2������v���v�/A�/A�B�B�C�����v���v�~�~�>�>�?����������� @�@�Arc�V�tj�tjd�y)Nr)rrr
s r�test_openlog_noargszTest.test_openlog_noargs3s�������
�
�<�=rc�8���tj��d���fd�}��fd�}tj�}t	j
d�	tj|��g}|td�D�cgc]}tj|����c}z
}tj|�5�j�tjd�d�ddd�tj
|�ycc}w#1swY�$xYw#tj
|�wxYw)	NFc�r���jd�d}�s!tjd|���|dz
}�s� yy)N�
�zpython-test-)�waitrr)�i�start�stops ��r�openerz)Test.test_syslog_threaded.<locals>.opener;s7����J�J�r�N��A������a�S�1�2��Q���rc�^���jd��stjd��s�yy)Nr3r)r5r)r7r8s��r�loggerz)Test.test_syslog_threaded.<locals>.loggerAs#����J�J�r�N���
�
�D�E�rg��&�.>)�targetr3g�������?T)
�	threading�Event�sys�getswitchintervalr�setswitchinterval�Thread�ranger�
start_threads�set�time�sleep)rr9r;�orig_si�threads�kr7r8s      @@r�test_syslog_threadedzTest.test_syslog_threaded7s�������!����	�	F�
�'�'�)���!�!�$�'�	+� �'�'�v�6�7�G���r��K��A�	�(�(��7��K�K�G�!�/�/��8��	�	���
�
�3����9�

�!�!�'�*��
L�8�8��

�!�!�'�*�s6�%D�4C1�D�+(C6�D�1D�6C?�;D�Dc���|jd�5td�}tj|�}|j	|d�ddd�t
j
�	|jd�5td�}tj|�}|j	|d�ddd�t
j�y#1swY�xYw#1swY�*xYw#t
j�wxYw)Nzbefore openlog()a
                import syslog
                caught_error = False
                try:
                    syslog.syslog('foo')
                except RuntimeError:
                    caught_error = True
                assert(caught_error)
            rzafter openlog()z\
                    import syslog
                    syslog.syslog('foo')
                )�subTestrr�run_in_subinterpr%rrr�r�code�ress   r�test_subinterpreter_syslogzTest.test_subinterpreter_syslogRs����\�\�,�
-����D��*�*�4�0�C����S�!�$�.�	����		����/�0������.�.�t�4��� � ��a�(�
1�
�O�O��/.�
-��1�0��
�O�O��s/�3C�"C�33C�&C�C�C�C�C1c���	td�}tj|�}|j|d�tj�y#tj�wxYw)Nz�
                import syslog
                caught_error = False
                try:
                    syslog.openlog()
                except RuntimeError:
                    caught_error = True

                assert(caught_error)
            r)rrrNr%rrrOs   r�test_subinterpreter_openlogz Test.test_subinterpreter_openlognsM��	��	�	�D��*�*�4�0�C����S�!�$��O�O���F�O�O��s�2A	�	Ac���tjd�	td�}tj|�}|j|d�tj
�y#tj
�wxYw)Nrz�
                import syslog
                caught_error = False
                try:
                    syslog.closelog()
                except RuntimeError:
                    caught_error = True

                assert(caught_error)
            r)rrrrrNr%rrOs   r�test_subinterpreter_closelogz!Test.test_subinterpreter_closelogsY�����x� �	��	�	�D��*�*�4�0�C����S�!�$��O�O���F�O�O��s�2A�A4N)�__name__�
__module__�__qualname__rrrrr r(r.r0r�requires_working_threadingrKrRrTrV�rrr	r	s]���H�
L�
L�
�
;�B�>�1��0�0�2�+�3�+�4�8�"rr	�__main__)�test.supportrr�
import_moduler�testrr?r=rF�unittest�textwrapr�TestCaser	rW�mainr[rr�<module>rds[��8�	$��	$�	$�X�	.���
�����A�8���A�H�z���H�M�M�O�r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists