o
    (]^'  ã                   @   sZ   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	d	e
d
ee
 fdd„ZdS )é    )Ú	hasmethod)ÚMatcher)ÚSubstringMatcherzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtc                       s8   e Zd Zd
‡ fdd„Zdedefdd„Zdd	„ Z‡  ZS )ÚStringEndsWithÚreturnNc                    s   t t| ƒ |¡ d S )N)Úsuperr   Ú__init__)ÚselfÚ	substring©Ú	__class__© úF/usr/lib/python3/dist-packages/hamcrest/library/text/stringendswith.pyr      s   zStringEndsWith.__init__Úitemc                 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)r   N)	Ú__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)Úhamcrest.core.helpers.hasmethodr   Úhamcrest.core.matcherr   Ú&hamcrest.library.text.substringmatcherr   Ú
__author__Ú__copyright__Ú__license__r   r   r   r   r   r   r   Ú<module>   s    