o
    (]^s  ã                   @   sf   d dl mZ 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e fdd„ZdS )é    )ÚBaseMatcher)ÚDescription)Úwrap_matcher)ÚMatcherzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtc                   @   sF   e Zd Zde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 )Ú	HasStringÚstr_matcherÚreturnNc                 C   s
   || _ d S ©N)r   )Úselfr   © r   úC/usr/lib/python3/dist-packages/hamcrest/library/object/hasstring.pyÚ__init__   s   
zHasString.__init__Úitemc                 C   s   | j  t|ƒ¡S r	   )r   ÚmatchesÚstr)r
   r   r   r   r   Ú_matches   s   zHasString._matchesÚdescriptionc                 C   s   |  d¡ | j¡ d S )Nzan object with str )Zappend_textZappend_description_ofr   )r
   r   r   r   r   Údescribe_to   s   zHasString.describe_to)Ú__name__Ú
__module__Ú__qualname__r   r   r   ÚobjectÚboolr   r   r   r   r   r   r   r      s    r   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.descriptionr   Z"hamcrest.core.helpers.wrap_matcherr   Zhamcrest.core.matcherr   Ú
__author__Z__copyright__Z__license__r   r   r   r   r   r   r   Ú<module>   s    