B
    u9aà  ã               @   sF   d dl mZ d dlmZ d dlZG dd„ dejƒZedkrBe ¡  dS )é    )ÚUserList)Ú
list_testsNc                   sd   e Zd ZeZ‡ fdd„Zdd„ Zdd„ Zdd„ Z‡ fd	d
„Z	dd„ Z
dd„ Zdd„ Zdd„ Z‡  ZS )ÚUserListTestc                s¢   t ƒ  ¡  dddddg}|  |¡}xztddƒD ]l}|  |d |… |d |… ¡ |  ||d … ||d … ¡ x.tddƒD ] }|  |||… |||… ¡ qvW q.W d S )Nr   é   é   é   é   éýÿÿÿé   )ÚsuperÚtest_getsliceÚ	type2testÚrangeÚassertEqual)ÚselfÚlÚuÚiÚj)Ú	__class__© ú#/usr/lib/python3.7/test_userlist.pyr   
   s    

zUserListTest.test_getslicec             C   sD   dddddg}t |ƒ}|  |d d … |j¡ |  |d d … |¡ d S )Nr   r   r   r   r   )r   ZassertIsInstancer   r   )r   r   r   r   r   r   Útest_slice_type   s    zUserListTest.test_slice_typec             C   s$   t dƒ}|d }|  |tdƒ¡ d S )NÚspamÚeggsÚspameggs)r   r   Úlist)r   r   Úu2r   r   r   Útest_add_specials   s    zUserListTest.test_add_specialsc             C   sB   t dƒ}d| }|  |tdƒ¡ | t dƒ¡}|  |tdƒ¡ d S )Nr   r   r   )r   r   r   Ú__radd__)r   r   r   r   r   r   Útest_radd_specials   s
    zUserListTest.test_radd_specialsc                s:   t ƒ  ¡  ddg}|tddgƒ7 }|  |ddddg¡ d S )Nr   r   )r   Ú	test_iaddr   r   )r   r   )r   r   r   r!   &   s    
zUserListTest.test_iaddc             C   s@   |   ddg¡}|  |ddg¡ |  |dg¡ |  |ddg¡ d S )Nr   r   r   )r   r   ZassertNotEqual)r   r   r   r   r   Útest_mixedcmp,   s    zUserListTest.test_mixedcmpc             C   s:   |   ddg¡}|  |g  |¡ |  |dg dddg¡ d S )Nr   r   r   )r   r   )r   r   r   r   r   Útest_mixedadd2   s    zUserListTest.test_mixedaddc             C   s.   G dd„ d| j ƒ}|  tt|dƒƒƒd¡ d S )Nc               @   s   e Zd Zdd„ ZdS )z1UserListTest.test_getitemoverwriteiter.<locals>.Tc             S   s   t |ƒd S )Nz!!!)Ústr)r   Úkeyr   r   r   Ú__getitem__:   s    z=UserListTest.test_getitemoverwriteiter.<locals>.T.__getitem__N)Ú__name__Ú
__module__Ú__qualname__r&   r   r   r   r   ÚT9   s   r*   )r   r   z0!!!)r   r   ÚnextÚiter)r   r*   r   r   r   Útest_getitemoverwriteiter7   s    z&UserListTest.test_getitemoverwriteiterc             C   s@   |   dddddg¡}| ¡ }|  ||¡ |  t|ƒt|ƒ¡ d S )Nr
   é   r   é	   )r   Úcopyr   Útype)r   r   Úvr   r   r   Útest_userlist_copy>   s    zUserListTest.test_userlist_copy)r'   r(   r)   r   r   r   r   r   r    r!   r"   r#   r-   r3   Ú__classcell__r   r   )r   r   r      s   
r   Ú__main__)	Úcollectionsr   Ztestr   ZunittestZ
CommonTestr   r'   Úmainr   r   r   r   Ú<module>   s
   =