U
    ôbÛVâ  ã                   @   s@   d dl mZ d dlmZ dZdZdZG dd„ deƒZdd	„ Zd
S )é    )ÚBaseMatcher)Úwrap_matcherzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtc                   @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )Ú	HasStringc                 C   s
   || _ d S ©N)Ústr_matcher)Úselfr   © r   úC/usr/lib/python3/dist-packages/hamcrest/library/object/hasstring.pyÚ__init__   s    zHasString.__init__c                 C   s   | j  t|ƒ¡S r   )r   ZmatchesÚstr)r   Úitemr   r   r	   Ú_matches   s    zHasString._matchesc                 C   s   |  d¡ | j¡ d S )Nzan object with str )Zappend_textZappend_description_ofr   )r   Zdescriptionr   r   r	   Údescribe_to   s    
ÿzHasString.describe_toN)Ú__name__Ú
__module__Ú__qualname__r
   r   r   r   r   r   r	   r   	   s   r   c                 C   s   t t| ƒƒS )aR  Matches if ``str(item)`` satisfies a given matcher.

    :param match: The matcher to satisfy, or an expected value for
        :py:func:`~hamcrest.core.core.isequal.equal_to` matching.

    This matcher invokes the :py:func:`str` function on the evaluated object to
    get its length, passing the result to a given matcher for evaluation. If
    the ``match`` argument is not a matcher, it is implicitly wrapped in an
    :py:func:`~hamcrest.core.core.isequal.equal_to` matcher to check for
    equality.

    Examples::

        has_string(starts_with('foo'))
        has_string('bar')

    )r   r   )Úmatchr   r   r	   Ú
has_string   s    r   N)	Zhamcrest.core.base_matcherr   Z"hamcrest.core.helpers.wrap_matcherr   Ú
__author__Z__copyright__Z__license__r   r   r   r   r   r	   Ú<module>   s   