%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/twisted/trial/test/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/twisted/trial/test/__pycache__/test_matchers.cpython-312.pyc

�

Ϫ�f����dZddlmZmZmZmZmZddlmZddl	m
Z
ddlmZddl
mZmZmZddlmZddlmZd	d
lmZGd�de�Zy
)z+
Tests for L{twisted.trial.test.matchers}.
�)�anything�assert_that�contains_string�equal_to�not_)�AllOf)�StringDescription)�given)�just�sampled_from�text)�FilePath)�SynchronousTestCase�)�fileContentsc��eZdZdZee�ed��dededdfd��Zeed�e	gd	���dededdfd
��Z
dd�Zy)
�FileContentsTestsz$
    Tests for L{fileContents}.
    �utf-8�contents�encoding�returnNc�4�t|j��}|j|j|��t	�}tt
t|��j||�td��tt|�td��y)ah
        L{fileContents} matches a L{IFilePath} that refers to a file that
        contains a string that is matched by the parameterized matcher.

        :param contents: The text string to place in the file and match
            against.

        :param encoding: The text encoding to use to encode C{contents} when
            writing to the file.
        T�N)
r�mktemp�
setContent�encoder	rrr�matches�str��selfrr�p�descriptions     �B/usr/lib/python3/dist-packages/twisted/trial/test/test_matchers.py�test_matcheszFileContentsTests.test_matchessn��
�T�[�[�]�#��	���X�_�_�X�.�/�'�)�����(�+�,�4�4�Q��D�h�t�n�	
�	�C��$�h�r�l�3�z!some text, it doesn't matter what)�asciizlatin-1rc�L�t|j��}|j|j|��t	�}tt
tt���j||�td��tt|�td|�d���y)a|
        L{fileContents} does not match an L{IFilePath} that refers to a
        file that contains a string that is not matched by the parameterized
        matcher.

        :param contents: The text string to place in the file and match
            against.

        :param encoding: The text encoding to use to encode C{contents} when
            writing to the file.
        Fzwas <�>N)rrrrr	rrrrrrrrs     r#�test_mismatchesz!FileContentsTests.test_mismatches)sy�� 
�T�[�[�]�#��	���X�_�_�X�.�/�'�)�����h�j�)�*�2�2�1�k�B�H�U�O�	
�	�C��$�h��q�c��|�&<�=r%c�R�t|j��}t�}tt	t��j
||�td��tt|�ttd�td�tt|j����y)zq
        L{fileContents} reports details of any I/O error encountered while
        attempting to match.
        Fr�FileNotFoundErrorN)
rrr	rrrrrrrr�repr�path)r r!r"s   r#�test_ioerrorzFileContentsTests.test_ioerrorBsy��

�T�[�[�]�#��'�)���L���,�4�4�Q��D�h�u�o�V��������/�� 3�4� ��Q�V�V��-�
�	
r%)rN)�__name__�
__module__�__qualname__�__doc__r
r
rrr$rr)r.�r%r#rrs�����4�6�4��=�!�4�S�4�C�4�D�4�"�4�(��
0�1��2�3��>��>�s�>�t�>�	�>�*
r%rN)r2�hamcrestrrrrr�hamcrest.core.core.allofr� hamcrest.core.string_descriptionr	�
hypothesisr
�hypothesis.strategiesrrr
�twisted.python.filepathr�twisted.trial.unittestr�matchersrrr3r%r#�<module>r<s:���L�K�*�>��:�:�,�6�"�H
�+�H
r%

Zerion Mini Shell 1.0