U
    42i                     @   s`   d dl Z d dlZd dlmZ zd dlmZ W n ek
rH   d dlZY nX G dd dejZdS )    N)sendc                   @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
	UnitTestsc                 C   s:   t d| _t jdt  dd| _| j  | j  d S )Nz$sendgrid.helpers.inbound.send.Clientz"sendgrid.helpers.inbound.send.openT)create)mockpatchclient_mockZ	mock_open	open_mockstartself r   ?/tmp/pip-unpacked-wheel-clku7wca/test/unit/test_inbound_send.pysetUp   s     
zUnitTests.setUpc                 C   s   | j   | j  d S )N)r   stopr   r
   r   r   r   tearDown   s    
zUnitTests.tearDownc                 C   s2   d}t |}|| t jj|dddd d S )Nhttps://fake_urlSendGrid-Test#multipart/form-data; boundary=xYzZYz
User-AgentzContent-TypehostZrequest_headers)r   ZSendZtest_payloadClientassert_called_once_with)r   fake_urlxr   r   r   	test_send   s    

zUnitTests.test_sendc              	   C   sJ   d}t jdtj|ddd$ t  tjj|dddd	 W 5 Q R X d S )
Nr   z"argparse.ArgumentParser.parse_argsztest_file.txt)r   data)Zreturn_valuer   r   r   r   )r   r   argparse	Namespacer   mainr   r   )r   r   r   r   r   test_main_call%   s     zUnitTests.test_main_callN)__name__
__module____qualname__r   r   r   r    r   r   r   r   r      s   r   )	r   ZunittestZsendgrid.helpers.inboundr   Zunittest.mockr   ImportErrorZTestCaser   r   r   r   r   <module>   s   