
    tf                         d Z ddlmZmZmZmZmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZmZmZ ddlmZ ddlmZ d	d
lmZ  G d de          ZdS )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                       e Zd ZdZ e e             ed                    dededdfd            Z e ed           e	g d	                    dededdfd
            Z
ddZdS )FileContentsTestsz$
    Tests for L{fileContents}.
    utf-8contentsencodingreturnNc                    t          |                                           }|                    |                    |                     t	                      }t          t          t          |                                        ||          t          d                     t          t          |          t          d                     dS )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	   r   r   r   matchesstrselfr   r   pdescriptions        _/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/trial/test/test_matchers.pytest_matcheszFileContentsTests.test_matches   s     T[[]]##	X__X..///'))(++,,44QDDhtnn	
 	
 	
 	C$$hrll33333    z!some text, it doesn't matter what)asciizlatin-1r   c                    t          |                                           }|                    |                    |                     t	                      }t          t          t          t                                          	                    ||          t          d                     t          t          |          t          d| d                     dS )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.
        Fzwas <>N)r   r   r   r   r	   r   r   r   r   r   r   r   r   s        r#   test_mismatchesz!FileContentsTests.test_mismatches)   s      T[[]]##	X__X..///'))hjj))**221kBBHUOO	
 	
 	
 	C$$h|q|||&<&<=====r%   c                    t          |                                           }t                      }t          t	          t                                                    ||          t          d                     t          t          |          t          t          d          t          d          t          t          |j                                                 dS )zq
        L{fileContents} reports details of any I/O error encountered while
        attempting to match.
        Fr   FileNotFoundErrorN)r   r   r	   r   r   r   r   r   r   r   r   reprpath)r    r!   r"   s      r#   test_ioerrorzFileContentsTests.test_ioerrorB   s    
 T[[]]##'))L,,44QDDhuooVVV// 344  QV-- 	
 	
 	
 	
 	
r%   )r   N)__name__
__module____qualname____doc__r
   r   r   r   r$   r   r)   r.    r%   r#   r   r      s          U446644==!!4S 4C 4D 4 4 4 "!4( U01122233 > >s >t > > >	 >*
 
 
 
 
 
r%   r   N)r2   hamcrestr   r   r   r   r   hamcrest.core.core.allofr    hamcrest.core.string_descriptionr	   
hypothesisr
   hypothesis.strategiesr   r   r   twisted.python.filepathr   twisted.trial.unittestr   matchersr   r   r3   r%   r#   <module>r<      s    L K K K K K K K K K K K K K * * * * * * > > > > > >       : : : : : : : : : : , , , , , , 6 6 6 6 6 6 " " " " " "H
 H
 H
 H
 H
+ H
 H
 H
 H
 H
r%   