o
    w+f                     @   s^   d dl Z d dlZd dlmZ zd dlmZ W n ey#   d dlZY nw 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_mock	mock_open	open_mockstartself r   N/var/www/html/venv/lib/python3.10/site-packages/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hostrequest_headers)r   Sendtest_payloadClientassert_called_once_with)r   fake_urlxr   r   r   	test_send   s   


zUnitTests.test_sendc                 C   s`   d}t jdtj|ddd t  tjj|dddd	 W d    d S 1 s)w   Y  d S )
Nr   z"argparse.ArgumentParser.parse_argsztest_file.txt)r   data)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"   unittestsendgrid.helpers.inboundr   unittest.mockr   ImportErrorTestCaser   r   r   r   r   <module>   s    