U
    ôbÛVï  ã                   @   s@   d Z dZdZddlmZ ddlmZ G dd„ deƒZdd	„ Zd
S )zJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txté    )ÚSubstringMatcher)Ú	hasmethodc                       s,   e Zd Z‡ fdd„Zdd„ Zdd„ Z‡  ZS )ÚStringStartsWithc                    s   t t| ƒ |¡ d S )N)Úsuperr   Ú__init__)ÚselfÚ	substring©Ú	__class__© úH/usr/lib/python3/dist-packages/hamcrest/library/text/stringstartswith.pyr      s    zStringStartsWith.__init__c                 C   s   t |dƒsdS | | j¡S )NÚ
startswithF)r   r   r   )r   Úitemr   r   r   Ú_matches   s    
zStringStartsWith._matchesc                 C   s   dS )Nzstarting withr   )r   r   r   r   Úrelationship   s    zStringStartsWith.relationship)Ú__name__Ú
__module__Ú__qualname__r   r   r   Ú__classcell__r   r   r	   r   r   	   s   r   c                 C   s   t | ƒS )a^  Matches if object is a string starting 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 beginning characters of the evaluated
    object.

    Example::

        starts_with("foo")

    will match "foobar".

    )r   )r   r   r   r   Ústarts_with   s    r   N)	Ú
__author__Z__copyright__Z__license__Z&hamcrest.library.text.substringmatcherr   Zhamcrest.core.helpers.hasmethodr   r   r   r   r   r   r   Ú<module>   s   