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_dbm_gnu.cpython-312.opt-1.pyc

�

'Μg�����ddlmZddlmZmZej
d�ZddlZddlZddl	m
Z
mZmZm
Z
e
ZGd�dej�Zedk(rej$�yy)	�)�support)�
import_helper�cpython_onlyzdbm.gnuN)�TESTFN�TESTFN_NONASCII�unlink�FakePathc���eZdZed��Zd�Zd�Zed��Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�Zej*ed�d��Zd�Zd�Zd�Zd�Zy)�TestGdbmc�n�tjr	ddlm}t	d|���yy#t
$rYywxYw)Nr)�
_GDBM_VERSIONzgdbm version: )r�verbose�_gdbmr
�print�ImportError)�versions �./usr/local/lib/python3.12/test/test_dbm_gnu.py�
setUpClasszTestGdbm.setUpClasss;���?�?�
2�:���w�i�0�1�
���
��
�s�(�	4�4c��d|_y�N��g��selfs r�setUpzTestGdbm.setUps	�����c�n�|j�|jj�tt�yr)r�closer�filenamers r�tearDownzTestGdbm.tearDowns!���6�6���F�F�L�L�N��x�rc��tjtd�|_t	j
|t
|j��y�N�c)�gdbm�openrrr�check_disallow_instantiation�typers r�test_disallow_instantiationz$TestGdbm.test_disallow_instantiations.�����8�S�)����,�,�T�4����<�@rc���tjtd�|_|j	|jj�g�d|jd<d|jd<d|jd<t
|jj��}|j	|t
gd���|jd|j�|jd	|j�|j	|jdd�|jj�}|rA|j||�|j|�|jj|�}|r�A|j	|jjd	�d
�|j|jjd��|j	|jjdd�d�|jt�5|jd
ddd�|j	|jjdd�d�|j	|jdd�y#1swY�UxYw)Nr#�b�a�019237410982340912840198242�12345678910sdata�bytes)�ar.s12345678910r/�bsxxxsfoo�xxx)r$r%rr�assertEqual�keys�set�assertIn�firstkey�remove�nextkey�get�assertIsNone�assertRaises�KeyError�
setdefault)r�key_set�keys   r�test_key_methodszTestGdbm.test_key_methods$s������8�S�)�������������+�����s�� =����}��"����x���d�f�f�k�k�m�$������#�&F�"G�H��
�
�c�4�6�6�"��
�
�d�D�F�F�#��������)�7�3��f�f�o�o�����M�M�#�w�'��N�N�3���&�&�.�.��%�C��
	
��������D�)�4�0����$�&�&�*�*�V�,�-���������F�F�3�V�<�
�
�
�x�
(��F�F�5�M�)�������*�*�6�6�:�F�C����������0�)�
(�s�I%�%I.c���tt��jtjtj
td�tjtd��_�jj��jtj�fd���jtjd��y)N�rr#c�"���jdS)Nr+rrs�r�<lambda>z0TestGdbm.test_error_conditions.<locals>.<lambda>Ds
���d�f�f�S�krc�R�tjtd�j�S)N�rx)r$r%rr�rrrDz0TestGdbm.test_error_conditions.<locals>.<lambda>Fs��d�i�i��$�.G�.M�.M�.Or)rrr;r$�errorr%rrrs`r�test_error_conditionszTestGdbm.test_error_conditions=sp����x�����$�*�*�d�i�i��3�?����8�S�)������������$�*�*�&9�:����$�*�*�&O�Prc��ttj�}|td�z
}t|�D];}tj	t
|�|_|jj��=|td�z
}|D]E}|D]>}tj	t
||z�|_|jj��@�Gy)N�fsu�crwn)r4r$�
open_flags�sortedr%rrr)r�all�modes�mode�flags�flags      r�
test_flagszTestGdbm.test_flagsHs����$�/�/�"���c�%�j� ���5�M�D��Y�Y�x��.�D�F��F�F�L�L�N�"�
�c�&�k�!���D������8�T�D�[�9����������rc�p�tjtd�|_tj
j
t�}t|d�}d|z|jd<tj
j
t�}|j||�|jd=|jtj
j
t�|�|jj�tj
j
t�}|j||�|j||�y)Nr#i'�x)
r$r%rr�os�path�getsize�max�
assertGreaterr2�
reorganize�
assertLess�assertGreaterEqual)r�size0�
value_size�size1�size2s     r�test_reorganizezTestGdbm.test_reorganizeXs������8�S�)���������)��
���&�
��J�&����s��������)�����5�%�(��F�F�3�K����������2�E�:�������������)������u�%�����u�-rc���tjtd�5}d|d<ddd�tjtd�5}|jt	|j��dg�ddd�|j
tj�5}j�ddd�|jtj�d�y#1swY��xYw#1swY�sxYw#1swY�GxYw)Nr#zcontext managerzgdbm context managerrBsgdbm context managerz#GDBM object has already been closed)
r$r%rr2�listr3r;rH�str�	exception)r�db�cms   r�test_context_managerzTestGdbm.test_context_managerms���
�Y�Y�x��
%��):�B�%�&�&��Y�Y�x��
%�����T�"�'�'�)�_�/F�.G�H�&��
�
�t�z�z�
*�b��G�G�I�+�����R�\�\�*�>�	@�&�
%��&�
%��+�
*�s#�C�+C �C,�C� C)�,C5c��tjtd�5}|jt	|��ddd�y#1swYyxYwr")r$r%r�assertFalse�bool�rrhs  r�test_bool_emptyzTestGdbm.test_bool_emptyys0��
�Y�Y�x��
%�����T�"�X�&�&�
%�
%�s	�?�Ac��tjtd�5}d|d<|jt	|��ddd�y#1swYyxYw�Nr#r*r+)r$r%r�
assertTruermrns  r�test_bool_not_emptyzTestGdbm.test_bool_not_empty}s7��
�Y�Y�x��
%���B�s�G��O�O�D��H�%�&�
%�
%�s� A�A
c��tjtd�5}d|d<ddd�|jtjt
�y#1swY�/xYwrq)r$r%rr;rHrmrns  r�test_bool_on_closed_db_raisesz&TestGdbm.test_bool_on_closed_db_raises�s?��
�Y�Y�x��
%���B�s�G�&����$�*�*�d�B�/�&�
%�s�A�Ac�n�tjtd�5}d|d<ddd�tjtd�5}|jt	|j��dg�|j
d|v�|j|dd�ddd�y#1swY�xYw#1swYyxYw)Nr#s
bytes value �sbytes key �rB)r$r%rr2rer3rrrns  r�
test_byteszTestGdbm.test_bytes�s���
�Y�Y�x��
%��$7�B� �!�&�
�Y�Y�x��
%�����T�"�'�'�)�_�/@�.A�B��O�O�-��3�4����R� 1�2�4G�H�&�
%�&�
%��
%�
%�s�B�AB+�B(�+B4c�J�tjtd�5}d|d<ddd�tjtd�5}|jt	|j��dj
�g�|jdj
�|v�|jd|v�|j|dj
�dj
��|j|ddj
��ddd�y#1swY��xYw#1swYyxYw)Nr#uUnicode value 🐍uUnicode key 🐍rB)r$r%rr2rer3�encoderrrns  r�test_unicodezTestGdbm.test_unicode�s���
�Y�Y�x��
%��+E�B�'�(�&�
�Y�Y�x��
%�����T�"�'�'�)�_�/G�/N�/N�/P�.Q�R��O�O�4�;�;�=��C�D��O�O�4��:�;����R� 8� ?� ?� A�B�7�>�>�@�
B����R� 8�9�7�>�>�@�
B�
&�
%�&�
%��
%�
%�s�D
�CD�
D�D"c��tjtd�5}d|d<ddd�tjtd�5}|jtj�5|d=ddd�|jtj�5|d=ddd�|jtj�5d|d<ddd�ddd�y#1swY��xYw#1swY�vxYw#1swY�WxYw#1swY�6xYw#1swYyxYw)Nr#sbytes values	bytes keyrBs
not exist keysnot exist value)r$r%rr;rHrns  r�test_write_readonly_filez!TestGdbm.test_write_readonly_file�s���
�Y�Y�x��
%��-�B�|��&�
�Y�Y�x��
%���"�"�4�:�:�.��'�(�/��"�"�4�:�:�.��|�$�/��"�"�4�:�:�.�'9��#�$�/�&�
%�&�
%��/�.��.�.��.�.��&�
%�s_�C� D�#C�''D�C(�'D�9C4�?D�C�C%	�!D�(C1	�-D�4C=	�9D�D	z*requires OS support of non-ASCII encodingsc���t}|jt|�tj	|d�5}d|d<ddd�|jtjj|��tj	|d�5}|jt|j��dg�|jd|v�|j|dd�ddd�y#1swY��xYw#1swYyxYw)Nr#svalueskeyrB)r�
addCleanuprr$r%rrrWrX�existsr2rer3)rrrhs   r�test_nonascii_filenamezTestGdbm.test_nonascii_filename�s���#�������)�
�Y�Y�x��
%��!�B�v�J�&���������x�0�1�
�Y�Y�x��
%�����T�"�'�'�)�_�v�h�7��O�O�F�b�L�)����R��Z��2�&�
%�&�
%��&�
%�s�C!�AC-�!C*�-C6c�0�d}|jtj�5}tj|�ddd�|j	|tj��|j|jj|�y#1swY�UxYw)Nznonexisting-file)	r;r$rHr%r5rfrgr2r)r�nonexisting_fileris   r�test_nonexisting_filezTestGdbm.test_nonexisting_file�sj��-��
�
�
�t�z�z�
*�b��I�I�&�'�+��
�
�&��B�L�L�(9�:�������.�.�0@�A�+�
*�s�B�Bc�f�tjtt�d�j	�yr")r$r%r	rrrs r�test_open_with_pathlib_pathz$TestGdbm.test_open_with_pathlib_path�s���	�	�(�8�$�c�*�0�0�2rc�z�tjtjt�d�j�yr")r$r%rW�fsencoderrrs r�test_open_with_bytes_pathz"TestGdbm.test_open_with_bytes_path�s"���	�	�"�+�+�h�'��-�3�3�5rc��tjttjt
��d�j
�yr")r$r%r	rWr�rrrs r�!test_open_with_pathlib_bytes_pathz*TestGdbm.test_open_with_pathlib_bytes_path�s'���	�	�(�2�;�;�x�0�1�3�7�=�=�?rN)�__name__�
__module__�__qualname__�staticmethodrrr rr(r@rIrTrcrjrorsrurwrzr|�unittest�
skipUnlessrr�r�r�r�r�rGrrrrs����2��2���
�A��A�
1�2	Q�� .�*
@�'�&�
0�
I�
B�	:��X����E�G�	3�G�	3�B�3�6�@rr�__main__)�testr�test.supportrr�
import_moduler$r�rW�test.support.os_helperrrrr	r�TestCaserr��mainrGrr�<module>r�sa���4�"�}�"�"�9�-���	�L�L���v@�x� � �v@�r�z���H�M�M�O�r

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