
    t                        d dl mZ d dlZd dlmZ d dlmZ d dlZd dlm	Z	 d dl
mZ d dlmZmZmZmZmZmZmZmZmZmZ  G d d	      Z G d
 d      Z G d d      Zy)    )annotationsN)MessageDefect)
DUMMY_POOL)HTTPConnection)HTTPConnectionPool)
ClosedPoolErrorConnectTimeoutErrorEmptyPoolErrorHeaderParsingErrorHostChangedError	HTTPErrorLocationParseErrorMaxRetryErrorNewConnectionErrorReadTimeoutErrorc                  X   e Zd Zej                  j                  d ed       eedd       e	d       e
d       ed       ed ed             e ed      dd       e	d       e ed      d       e ed      d       e ed      dd       e ed      dd      g      d
d	       Zy)
TestPickle	exceptionN foo	localhost/zfake locationr   c                    t        j                  t        j                  |            }t        |t	        |            sJ y )N)pickleloadsdumps
isinstancetype)selfr   results      ;platform/gsutil/third_party/urllib3/test/test_exceptions.pytest_exceptionszTestPickle.test_exceptions   s/    $ fll956&$y/222    )r   	ExceptionreturnNone)__name__
__module____qualname__pytestmarkparametrizer   r   r   r   r	   IOErrorr   r   r
   r   r   r"    r#   r!   r   r      s    [[dO*b$/r"%eeWU^,,[93E/.{;R@-k:B?/<c1E/<c2F	
"3#"3r#   r   c                      e Zd ZddZy)
TestFormatc                l    t        t        d      gd      }dt        |      v sJ dt        |      v sJ y )Ndefectsunparsed_data)r   r   str)r   hpes     r!   test_header_parsing_errorsz%TestFormat.test_header_parsing_errors1   s:     -	":!;_MCH$$$#c(***r#   Nr%   r&   )r'   r(   r)   r6   r.   r#   r!   r0   r0   0   s    +r#   r0   c                      e Zd ZddZy)TestNewConnectionErrorc                D   t        t        d      d      }t        j                  t              5 }|j
                  }d d d        |j                  u sJ d}d   }t        |j                  t              sJ |j                  j                  d   |k(  sJ y # 1 sw Y   [xY w)Nr   testz\The 'pool' property is deprecated and will be removed in urllib3 v2.1.0. Use 'conn' instead.r   )r   r   r*   warnsDeprecationWarningpoolconnr   messageWarningargs)r   errrecordserr_poolmsgrecords         r!   &test_pool_property_deprecation_warningz=TestNewConnectionError.test_pool_property_deprecation_warning9   s     !<fE\\,-xxH . 388###5 	 &..'222~~""1%,,, .-s   BBNr7   )r'   r(   r)   rH   r.   r#   r!   r9   r9   8   s    -r#   r9   )
__future__r   r   email.errorsr   r;   r   r*   urllib3.connectionr   urllib3.connectionpoolr   urllib3.exceptionsr   r	   r
   r   r   r   r   r   r   r   r   r0   r9   r.   r#   r!   <module>rN      sG    "  &   - 5  3 3.+ +- -r#   