
                            d Z ddlmZ ddlZddlmZmZ ddlZ edd      Z ed      Z	 G d d	      Z
 G d
 de
      Zy)z
Test what happens if Python was built without SSL

* Everything that does not involve HTTPS should still work
* HTTPS requests must fail with an error that points at the ssl module
    )annotationsN)ImportBlockerModuleStashssl_sslurllib3c                  0    e Zd Zedd       Zedd       Zy)TestWithoutSSLc                    t         j                  j                  dd        t         j                  j                  dd        t        j	                          t         j
                  j                  dt               y )Nr   r   r   )sysmodulespopmodule_stashstash	meta_pathinsertssl_blockerclss    7platform/gsutil/third_party/urllib3/test/test_no_ssl.pysetup_classzTestWithoutSSL.setup_class   sF    t$%Q,    c                r    t         j                  j                  t               t        j                          y )N)r   r   remover   r   r   r   s    r   teardown_classzTestWithoutSSL.teardown_class   s     [)r   NreturnNone)__name__
__module____qualname__classmethodr   r    r   r   r
   r
      s(    - -  r   r
   c                      e Zd ZddZddZy)TestImportWithoutSSLc                h    t        j                  t              5  dd l}d d d        y # 1 sw Y   y xY wNr   )pytestraisesImportErrorr   )selfr   s     r   test_cannot_import_sslz+TestImportWithoutSSL.test_cannot_import_ssl#   s    ]];' (''s   (1c                    dd l }y r'   )r   )r+   r   s     r   test_import_urllib3z(TestImportWithoutSSL.test_import_urllib3'   s    r   Nr   )r   r    r!   r,   r.   r#   r   r   r%   r%   "   s    r   r%   )__doc__
__future__r   r   testr   r   r(   r   r   r
   r%   r#   r   r   <module>r2      sD    # 
 + E6*9% > r   