o
    w+f                     @   s:   d dl Z d dlZd dlZd dlmZ G dd dejZdS )    N)Configc                   @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
	UnitTestsc                 C   s   t  | _d S )N)r   config)self r   H/var/www/html/venv/lib/python3.10/site-packages/test/unit/test_config.pysetUp
   s   zUnitTests.setUpc                 C   sp   d}d}g d}d}|  | jj | | jj| | | jj| | | jj| |D ]
}| || jj q+d S )Nz/inboundi  )fromattachmentsheaderstextenvelopetohtml	sender_ipzattachment-infosubjectdkimSPFcharsetszcontent-idsspam_report
spam_scoreemailzhttp://127.0.0.1:5000/inbound)	
assertTruer   
debug_modeassertEqualendpointhostportassertInkeys)r   r   r   r   r   keyr   r   r   test_initialization   s   zUnitTests.test_initializationc                 C   s   t jjjj}dtjtj	|}t
|d}|d W d    n1 s(w   Y  t  t| | tjd d d S )Nz{0}/.envwzRANDOM_VARIABLE=RANDOM_VALUERANDOM_VARIABLERANDOM_VALUE)sendgridhelpersinboundr   __file__formatospathabspathdirnameopenwriter   remover   environr   config_fileenv_file_pathfr   r   r   0test_init_environment_should_set_env_from_dotenv,   s   
z:UnitTests.test_init_environment_should_set_env_from_dotenvc                 C   s~   t jjjj}tjtj|d }t	|d}|
d W d    n1 s'w   Y  t  t| | tjd d S )Nz/.envr"   z1RANDOM_VARIABLE=RANDOM_VALUE=ANOTHER_RANDOM_VALUEr#   )r%   r&   r'   r   r(   r*   r+   r,   r-   r.   r/   r   r0   assertIsNoner1   getr2   r   r   r   =test_init_environment_should_not_set_env_if_format_is_invalid5   s   
zGUnitTests.test_init_environment_should_not_set_env_if_format_is_invalidN)__name__
__module____qualname__r   r!   r6   r9   r   r   r   r   r      s
    	r   )r*   unittestsendgrid.helpers.inbound.configr%   r   TestCaser   r   r   r   r   <module>   s
    