
"[jX;  ã               @   s9   d  d l  Z  d  d l m Z Gd d „  d e  j ƒ Z d S)é    N)ÚCaseInsensitiveDefaultDictc               @   sp   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 S)ÚTestCIDDc             C   s=   t  ƒ  } d | d <|  j d | k ƒ |  j d | k ƒ d  S)Né*   ÚaBcÚabc)ÚCIDDÚ
assertTrue)ÚselfÚsample© r   ú/opt/Infobot/test/test_CIDD.pyÚtestContains   s    	
zTestCIDD.testContainsc             C   su   t  ƒ  } d | d <|  j | j d ƒ d ƒ d | d <|  j | j d ƒ d ƒ d } |  j | j d | ƒ | ƒ d  S)Nr   r   r   z!Life, the Universe and Everything)r   ÚassertEqualÚpop)r	   r
   Údefaultr   r   r   ÚtestPop   s    	

zTestCIDD.testPopc             C   sY   t  ƒ  } d | d <|  j | j d ƒ d ƒ | d =d } |  j | j d | ƒ | ƒ d  S)Nr   r   r   z!Life, the Universe and Everything)r   r   Úget)r	   r
   r   r   r   r   ÚtestGet   s    	
zTestCIDD.testGetc             C   sD   t  ƒ  } d | d <|  j | d d i ƒ | d =|  j | i  ƒ d  S)Nr   r   r   )r   r   )r	   r
   r   r   r   Ú
testDelete"   s
    	
zTestCIDD.testDeletec             C   s'   t  d g  ƒ } |  j | d g  ƒ d S)zL
        This test checks whether the dict behaves as a defaultdict
        r   ÚABCN)r   r   )r	   r
   r   r   r   ÚtestDefaultGet*   s    zTestCIDD.testDefaultGetc             C   s;   t  d g  ƒ } | d j d ƒ |  j | d | j ƒ d S)zc
        This test checks whether the provided default value gets
        copied properly.
        r   r   r   N)r   ÚappendÚassertNotEqualr   )r	   r
   r   r   r   ÚtestDefaultCopy1   s    zTestCIDD.testDefaultCopyc             C   s+   t  ƒ  } d | d <|  j | d d ƒ d S)zS
        This test checks whether keys are compared
        insensitively.
        r   r   r   N)r   r   )r	   r
   r   r   r   ÚtestCaseInsensitivity:   s    	
zTestCIDD.testCaseInsensitivityc             C   sC   t  ƒ  } d | d <|  j | d d i ƒ |  j | d d i ƒ d S)zT
        This test checks whether key case is preserved
        internally.
        r   r   r   N)r   r   r   )r	   r
   r   r   r   ÚtestCasePreservationC   s    	
zTestCIDD.testCasePreservationN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r   r   r   r   r   r      s   
		r   )ZunittestZplugins.util.dictr   r   ÚTestCaser   r   r   r   r   Ú<module>   s   