o
    (]^O  ã                   @   s^   d dl mZ d dlmZ d dlmZ dZdZdZG dd„ dee	 ƒZ
d	e	d
ee	 fdd„ZdS )é    )ÚBaseMatcher)ÚDescription)ÚMatcherzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtc                   @   sB   e Zd Zdeddfdd„Zdedefdd„Zd	eddfd
d„ZdS )ÚIsEqualIgnoringCaseÚstringÚreturnNc                 C   s&   t |tƒs	tdƒ‚|| _| ¡ | _d S )Nz#IsEqualIgnoringCase requires string)Ú
isinstanceÚstrÚ	TypeErrorÚoriginal_stringÚlowerÚlowered_string)Úselfr   © r   úM/usr/lib/python3/dist-packages/hamcrest/library/text/isequal_ignoring_case.pyÚ__init__   s   
zIsEqualIgnoringCase.__init__Úitemc                 C   s   t |tƒsdS | j| ¡ kS )NF)r   r	   r   r   )r   r   r   r   r   Ú_matches   s   
zIsEqualIgnoringCase._matchesÚdescriptionc                 C   s   |  | j¡ d¡ d S )Nz ignoring case)Úappend_description_ofr   Úappend_text)r   r   r   r   r   Údescribe_to   s   zIsEqualIgnoringCase.describe_to)	Ú__name__Ú
__module__Ú__qualname__r	   r   Úboolr   r   r   r   r   r   r   r   
   s    r   r   r   c                 C   s   t | ƒS )a“  Matches if object is a string equal to a given string, ignoring case
    differences.

    :param string: The string to compare against as the expected value.

    This matcher first checks whether the evaluated object is a string. If so,
    it compares it with ``string``, ignoring differences of case.

    Example::

        equal_to_ignoring_case("hello world")

    will match "heLLo WorlD".

    )r   )r   r   r   r   Úequal_to_ignoring_case   s   r   N)Úhamcrest.core.base_matcherr   Úhamcrest.core.descriptionr   Úhamcrest.core.matcherr   Ú
__author__Ú__copyright__Ú__license__r	   r   r   r   r   r   r   Ú<module>   s    