U
    òÀMf'  ã                   @   sX   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ƒZ	e
ee
 d	œd
d„ZdS )é    )Ú	hasmethod)ÚMatcher)ÚSubstringMatcherzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtc                       s:   e Zd Zddœ‡ fdd„Zeedœdd„Zdd	„ Z‡  ZS )
ÚStringEndsWithN)Úreturnc                    s   t t| ƒ |¡ d S )N)Úsuperr   Ú__init__)ÚselfÚ	substring©Ú	__class__© úH/tmp/pip-unpacked-wheel-97nlcpo6/hamcrest/library/text/stringendswith.pyr      s    zStringEndsWith.__init__)Úitemr   c                 C   s   t |dƒsdS | | j¡S )NÚendswithF)r   r   r
   )r	   r   r   r   r   Ú_matches   s    
zStringEndsWith._matchesc                 C   s   dS )Nzending withr   )r	   r   r   r   Úrelationship   s    zStringEndsWith.relationship)	Ú__name__Ú
__module__Ú__qualname__r   ÚstrÚboolr   r   Ú__classcell__r   r   r   r   r   
   s   r   )Ústringr   c                 C   s   t | ƒS )aW  Matches if object is a string ending with a given string.

    :param string: The string to search for.

    This matcher first checks whether the evaluated object is a string. If so,
    it checks if ``string`` matches the ending characters of the evaluated
    object.

    Example::

        ends_with("bar")

    will match "foobar".

    )r   )r   r   r   r   Ú	ends_with   s    r   N)Zhamcrest.core.helpers.hasmethodr   Zhamcrest.core.matcherr   Z&hamcrest.library.text.substringmatcherr   Ú
__author__Ú__copyright__Ú__license__r   r   r   r   r   r   r   Ú<module>   s   