
    Df}                     D   d Z ddlZddlmZmZmZmZ ej                            deddfeddfeddff          d             Z	ej                            deef          d	             Z
d
 Zej                            dd ed          dff          d             Zd ZdS )z2Test suite for cross-python compatibility helpers.    N)extract_bytesntobntoubtonfuncinpoutbar   barc                 ,     | |d          |k    sJ dS )z;Check that compatibility functions work with correct input.utf-8encodingN r   s      H/var/www/media/lib/python3.11/site-packages/cheroot/test/test__compat.pytest_compat_functions_positiver      s*     4g&&&#------    r   c                     d}t          j        t                    5   | |d           ddd           dS # 1 swxY w Y   dS )zCCheck that compatibility functions fail loudly for incorrect input.r   r   r   N)pytestraises	TypeError)r   non_native_test_strs     r   (test_compat_functions_negative_nonnativer      s     !	y	!	! 4 4 733334 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4s   7;;c                  <    d} t          dd          }|| k    sJ dS )z<Check that ``ntou`` supports escape-encoding under Python 2.u
   hišřіїescaper   N)r   )expectedactuals     r   test_ntou_escaper   #   s1    H.BBBFXr   input_argumentexpected_result)   qwertyr#   s   asdfghc                 0    t          |           |k    sJ dS )z+Check that legitimate inputs produce bytes.N)r   r    s     r   test_extract_bytesr%   *   s#     ((O;;;;;;r   c                      t          j        t          d          5  t          d           ddd           dS # 1 swxY w Y   dS )z8Ensure that invalid input causes exception to be raised.z<^extract_bytes\(\) only accepts bytes and memoryview/buffer$)matchu   some юнікод їїїN)r   r   
ValueErrorr   r   r   r   test_extract_bytes_invalidr)   6   s    	%
 
 
 3 3
 	12223 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3s   9= =)__doc__r   cheroot._compatr   r   r   r   markparametrizer   r   r   
memoryviewr%   r)   r   r   r   <module>r/      sA   8 8  ; ; ; ; ; ; ; ; ; ; ; ; 	uf	uf	vu . . .
 
 4 4 4   )	I			* < < <
3 3 3 3 3r   