U
    42‹im  ã                   @   s*   d dl Z d dlmZ G dd„ de jƒZdS )é    N)ÚEmailc                   @   sT   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dd„ ZdS )ÚTestEmailObjectc                 C   s   d}t |ƒ}|  |jd¡ d S ©Nútest@example.com)r   ÚassertEqualÚemail)ÚselfÚaddressr   © r
   ú8/tmp/pip-unpacked-wheel-clku7wca/test/unit/test_email.pyÚtest_add_email_address	   s    z&TestEmailObject.test_add_email_addressc                 C   s    d}t |d}|  |j|¡ d S ©NÚSomeName)Úname©r   r   r   ©r   r   r   r
   r
   r   Útest_add_name   s    
zTestEmailObject.test_add_namec                 C   s    d}t |d}|  |j|¡ d S r   r   r   r
   r
   r   Útest_add_unicode_name   s    
z%TestEmailObject.test_add_unicode_namec                 C   s4   d}d}t ||d}|  |j|¡ |  |jd¡ d S ©Nr   r   )r   r   ©r   r   r   r   ©r   r   r	   r   r
   r
   r   Útest_add_name_email   s
    z#TestEmailObject.test_add_name_emailc                 C   s4   d}d}t ||d}|  |j|¡ |  |jd¡ d S r   r   r   r
   r
   r   Útest_add_unicode_name_email"   s
    z+TestEmailObject.test_add_unicode_name_emailc                 C   s*   d}t |ƒ}|  |j|¡ |  |j¡ d S ©Nr   )r   r   r   ZassertIsNoner   r   r
   r
   r   Ú*test_add_rfc_function_finds_name_not_email)   s    z:TestEmailObject.test_add_rfc_function_finds_name_not_emailc                 C   s<   d}d}d  ||¡}t|ƒ}|  |j|¡ |  |jd¡ d S )Nr   r   z{} <{}>)Úformatr   r   r   r   )r   r   r	   Zname_addressr   r
   r
   r   Útest_add_rfc_email0   s    z"TestEmailObject.test_add_rfc_emailc                 C   s"   t ƒ }d}||_|  |j|¡ d S r   )r   r   r   )r   r   r   r
   r
   r   Útest_empty_obj_add_name8   s    z'TestEmailObject.test_empty_obj_add_namec                 C   s"   t ƒ }d}||_|  |j|¡ d S r   )r   r   r   )r   r   r	   r
   r
   r   Útest_empty_obj_add_email?   s    z(TestEmailObject.test_empty_obj_add_emailN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r   r   r
   r
   r
   r   r      s   r   )ZunittestZsendgrid.helpers.mailr   ZTestCaser   r
   r
   r
   r   Ú<module>   s   