
    ,hX
                     Z    d dl mZmZmZ d dlmZ d dlmZ  G d dej                        Z	y)    )patchsentinelMock)
IMAPClient)unittestc                   0    e Zd Zd Zd Zd Zd Zd Zd Zy)TestInitc                 f   t        d      }|j                         | _        | j                  |j                         t        d      }|j                         | _        | j                  |j                         t        d      }|j                         | _        | j                  |j                         y )Nzimapclient.imapclient.imap4zimapclient.imapclient.tlszimapclient.imapclient.imaplib)r   startimap4
addCleanupstoptlsimaplib)selfpatchers     [/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/imapclient/test/test_init.pysetUpzTestInit.setUp   sz    56]]_
%34==?%78}}%    c                 >   t               }|| j                  j                  _        t	        dt
        j                        }| j                  |j                  |       | j                  j                  j                  ddt
        j                         | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  d        | j                  |j                  d       y )N1.2.3.4)timeout   F)r   r   IMAP4WithTimeoutreturn_valuer   r   r   assertEqual_imapassert_called_withhostportsslssl_contextstream)r   	fakeIMAP4imaps      r   
test_plainzTestInit.test_plain   s    F	3<

##0)X-=-=>Y/

##66s	
 	I.C(5)))40e,r   c                    t               }|| j                  j                  _        t	        ddt
        j                  t
        j                        }| j                  |j                  |       | j                  j                  j                  ddt
        j                  t
        j                         | j                  |j                  d       | j                  |j                  d       | j                  |j                  d       | j                  |j                  t
        j                         | j                  |j                  d       y )Nr   T)r!   r"   r   i  F)r   r   	IMAP4_TLSr   r   r   contextr   r   r   r   r   r    r!   r"   r#   )r   fakeIMAP4_TLSr%   s      r   test_SSLzTestInit.test_SSL+   s    *7')8;K;K"*"2"24 	]3--sh..	0 	I.C(4())8+;+;<e,r   c                    t         j                  | j                  j                  _        t	        dd      }| j                  |j                  t         j                         | j                  j                  j                  d       | j                  |j                  d       | j                  |j                  d        | j                  |j                  d       | j                  |j                  d       y )NcommandT)r#   F)r   IMAP4_streamr   r   r   r   r   r   r   r    r!   r#   )r   r%   s     r   test_streamzTestInit.test_stream<   s    191F1F!!.)D1X%:%:;!!44Y?I.D)5)d+r   c                 @    | j                  t        t        ddd       y )Nr-   T)r!   r#   assertRaises
ValueErrorr   r   s    r   test_ssl_and_stream_is_errorz%TestInit.test_ssl_and_stream_is_errorI   s    *j)dSr   c                 @    | j                  t        t        ddd       y )Nr-   T{   )r#   r    r1   r4   s    r   test_stream_and_port_is_errorz&TestInit.test_stream_and_port_is_errorL   s    *j)DsSr   N)	__name__
__module____qualname__r   r&   r+   r/   r5   r8    r   r   r	   r	      s"    &-"-",TTr   r	   N)
mockr   r   r   imapclient.imapclientr   imapclient.test.utilr   TestCaser	   r<   r   r   <module>rA      s)   
 ' & , )BTx   BTr   