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

�

'ΜgP����dZddlZddlZddlZddlmZddlmZ	ddlmZejZ
ejje
ej�Z
d�Zd�Zd�ZGd	�d
�ZGd�dej$�Ze�D]6Zej*d
dZde��Zeeeej$fdei�e�e<�8edk(rej4�yy#e$rdZY��wxYw)z=Test script for the dbm.open function based on testdumbdbm.py�N)�
import_helper)�	os_helper)�ndbmc#�K�tjD](}	t|dg��}|tj|<|���*y#t$rY�7wxYw�w)N�open)�fromlist)�dbm�_names�
__import__�ImportError�_modules)�name�mods  �*/usr/local/lib/python3.12/test/test_dbm.py�dbm_iteratorrsO�����
�
��	��T�V�H�5�C�!����T���	�
���	��	�s%�A�?�A�	A�A�
A�Ac�6�tjt�y�N)r�rmtree�dirname��r�cleaunup_test_dirr s��
���W�rc�J�t�tjt�yr)r�os�mkdirrrrr�setup_test_dirr#s�����H�H�W�rc��eZdZddddddd�Zd�Zd	�Zd
�Zd�Zd�Zd
�Z	d�Z
d�Zd�Zd�Z
d�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�AnyDBMTestCasesPython:sProgrammingstheswaysGuidosintended)�a�b�c�d�f�gc��tjtd�}|jD]#}|j|||j	d�<�%|j�y)N�n�ascii)r	r�_fname�_dict�encode�close)�selfr#�ks   r�init_dbzAnyDBMTestCase.init_db1sD���H�H�V�S�!�����A�#'�:�:�a�=�A�a�h�h�w�� ��	���	rc��td�|j�D��}t|jj��}|j||�|S)Nc3�>K�|]}|jd����y�w)r'N)�decode)�.0r-s  r�	<genexpr>z-AnyDBMTestCase.keys_helper.<locals>.<genexpr>8s����:��A�a�h�h�w�'��s�)�sorted�keysr)�assertEqual)r,r#r5�dkeyss    r�keys_helperzAnyDBMTestCase.keys_helper7sB���:�����:�:���t�z�z���(�)������u�%��rc�j�|jt|jjt��yr)�
assertTrue�
issubclass�module�error�OSError�r,s r�
test_errorzAnyDBMTestCase.test_error=s�����
�4�;�;�#4�#4�g�>�?rc�j�|jtjtjt�yr)�assertRaisesr	r=rr(r?s r�test_anydbm_not_existingz'AnyDBMTestCase.test_anydbm_not_existing@s�����#�)�)�S�X�X�v�6rc�0�tjtd�}|jt	|j��g�|jD]#}|j|||jd�<�%|j|�|j�y)Nr!r')
r	rr(r6�listr5r)r*�read_helperr+�r,r#�keys   r�test_anydbm_creationz#AnyDBMTestCase.test_anydbm_creationCsl���H�H�V�S�!������a�f�f�h���,��:�:�C�%)�Z�Z��_�A�c�j�j��!�"�������	���	rc���tjt�tjtd�5}|jt
|�d�ddd�y#1swYyxYw)Nr&r)r�create_empty_filer(r	rr6�len�r,r#s  r�8test_anydbm_creation_n_file_exists_with_invalid_contentszGAnyDBMTestCase.test_anydbm_creation_n_file_exists_with_invalid_contentsKs@���#�#�F�+�
�X�X�f�c�
"�a����S��V�Q�'�#�
"�
"�s�A�A"c�0�|j�tjtd�}dx|jd<|d<|j|�|j
|jdd�d�|j
|dd�|j�y)Nr!sindentedr$�g�xxx�foo)	r.r	rr(r)rFr6�
setdefaultr+rMs  r�test_anydbm_modificationz'AnyDBMTestCase.test_anydbm_modificationQsw�������H�H�V�S�!��$/�/��
�
�3��!�D�'������������f�f�5�v�>�����6��F�+�	���	rc���|j�tjtd�}|j	|�|j|j
d�|jd�|j|j
dd�d�|j|j
d��|jt�5|dddd�|j�y#1swY�xYw)N�r�arrQrR)r.r	rr(rFr6�getr)�assertIsNonerB�KeyErrorr+rMs  r�test_anydbm_readzAnyDBMTestCase.test_anydbm_read[s��������H�H�V�S�!�������������t��d�j�j��o�6�������v�v�.��7����!�%�%��-�(�
�
�
�x�
(�
�f�I�)�	���	�)�
(�s�C � C)c��|j�tjtd�}|j	|�}|j�y)NrV)r.r	rr(r8r+)r,r#r5s   r�test_anydbm_keyszAnyDBMTestCase.test_anydbm_keysgs4�������H�H�V�S�!������"��	���	rc��ttjdd�dk(r|jd�tjt
d�}|j
|j�g�d|d<|j
|j�dg�|jd|�|j
|dd�|j
|jd�d�|j
|jd�d�|j�y)N�libraryzBerkeley DBzCBerkeley DB doesn't distinguish the empty value from the absent oner!rsempty)�getattrr	�_defaultmod�skipTestrr(r6r5�assertInrXrSr+rMs  r�test_empty_valuezAnyDBMTestCase.test_empty_valuems����3�?�?�I�t�4�
�E��M�M�0�
1��H�H�V�S�!���������2�&���(���������H�:�.��
�
�h��"�����8��c�*�������x��#�.�������h�/��5�	���	rc��|j�tjtd�}dj	d�}|j||�|j
�y)NrVrr')r.r	rr(r*rcr+rGs   r�test_anydbm_accessz!AnyDBMTestCase.test_anydbm_access{s@�������H�H�V�S�!���j�j��!���
�
�c�1��	���	rc�z�tjtjt�d�j�y�Nr!)r	rr�fsencoder(r+r?s r�test_open_with_bytesz#AnyDBMTestCase.test_open_with_bytes�s"��������V�$�c�*�0�0�2rc�z�tjtjt�d�j�yrh)r	rr�FakePathr(r+r?s r�test_open_with_pathlib_pathz*AnyDBMTestCase.test_open_with_pathlib_path�s$������#�#�F�+�S�1�7�7�9rc��tjtjt	j
t��d�j�yrh)r	rrrlrrir(r+r?s r�!test_open_with_pathlib_path_bytesz0AnyDBMTestCase.test_open_with_pathlib_path_bytes�s-������#�#�B�K�K��$7�8�#�>�D�D�Frc��|j|�}|jD]3}|j|j|||jd���5y)Nr')r8r)r6r*)r,r#r5rHs    rrFzAnyDBMTestCase.read_helper�sF������"���:�:�C����T�Z�Z��_�a��
�
�7�0C�.D�E�rc����tjtd�5�|j�j	�g�ddg}|D]
\}}|�|<�|jt�j	��td�|D���|D],\}}|j
|��|j�||��.|jd��|jt�fd��ddd�y#1swYyxYw)Nr!)rW�b)s12345678910s019237410982340912840198242c3�&K�|]	\}}|���y�wrr)r2r-�vs   rr3z+AnyDBMTestCase.test_keys.<locals>.<genexpr>�s����5H�a�F�Q��a�a�s�rQc����dS)NrQr)r"s�r�<lambda>z*AnyDBMTestCase.test_keys.<locals>.<lambda>�s	����&�	r)
r	rr(r6r5r4rc�assertNotInrBrZ)r,rr-rtr"s    @r�	test_keyszAnyDBMTestCase.test_keys�s����
�X�X�f�c�
"�a����Q�V�V�X�r�*��O�P�A����1���!������V�A�F�F�H�-�v�5H�a�5H�/H�I����1��
�
�a��#�� � ��1��q�)��
���V�Q�'����h�(9�:�#�
"�
"�s�C	C.�.C7c��|jttdtj�|jt_|jt
�t
�y)Nra)�
addCleanup�setattrr	rar<rrr?s r�setUpzAnyDBMTestCase.setUp�s6�������m�S�_�_�E��+�+������)�*��rN)�__name__�
__module__�__qualname__r)r.r8r@rCrIrNrTr[r]rdrfrjrmrorFrxr|rrrrr(ss��� �����
�E���@�7��(��
����3�:�G�F�
;�rrc�L�eZdZd�Zej
ed��d��Zd�Zy)�WhichDBTestCasec��|jttdtj�t	j
t�}ttjt�|tj|�g}t�D]�}|j}t�|t_|jtd�5ddd�|D]-}|j||jj|���/|jtd�5}d|d<|jd|�|j|dd�ddd�|D]-}|j||jj|���/��y#1swY��xYw#1swY�JxYw)Nrar!�w�1)rzr{r	rarrir(rrlrr}rrr6�whichdbrc)r,�_bytes_fname�fnamesr<r�pathr#s       r�test_whichdbzWhichDBTestCase.test_whichdb�s+�������m�S�_�_�E��{�{�6�*���)�,�,�V�4��	� 2� 2�<� @�B��"�n�F��?�?�D���$�C�O����V�S�)�)���� � ��t�x�x�'7�'7��'=�>�����V�S�)�Q���$���
�
�d�A�&�� � ��4��$�/�*���� � ��t�x�x�'7�'7��'=�>��#%�*�)��*�)�s�<E7�
-F�7F	�F	zTest requires ndbm)�reasonc�P�ttdzd�5ddd�tjt�}tt	j
t�|t	j
|�g}|D],}|j
|jj|���.y#1swY��xYw)Nz.db�wb)	rr(rrirrlrYr	r�)r,r�r�r�s    r�test_whichdb_ndbmz!WhichDBTestCase.test_whichdb_ndbm�s{���&�5�.�$�
'�
'��{�{�6�*���)�,�,�V�4��	� 2� 2�<� @�B���D����d�h�h�.�.�t�4�5��	(�
'�s�B�B%c�v�|jt�t�tjd�|_y)Nr	)rzrrr�import_fresh_moduler	r?s rr|zWhichDBTestCase.setUp�s'�����)�*��� �4�4�U�;��rN)	r}r~rr��unittest�
skipUnlessrr�r|rrrr�r��s0��?�2�X����&:�;�6�<�6�<rr���	TestCase_r<�__main__)�__doc__r�r	r�test.supportrrrr�TESTFNrr��joinr(rrrr�TestCaser�rr}�suffix�testname�type�globals�mainrrr�<module>r�s���C��
�	�&�"����
�
��	�����g�y�/�/�	0��
���
z�z�z'<�h�'�'�'<�T�>�C�
�\�\�!�"�
�F��6�(�#�H��x� .��0A�0A�B� (�#��0�G�I�h��	��z���H�M�M�O���[���D��s�C�C�C

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