/usr/lib/python3/dist-packages/hamcrest/library/object/__pycache__
Edit: /usr/lib/python3/dist-packages/hamcrest/library/object/__pycache__/hasstring.cpython-310.pyc (2030B)
o
(]^s ã @ sf d dl mZ d dlmZ d dlmZ d dlmZ dZdZ dZ
G dd „ d ee ƒZd
ee fdd„Z
d
S )é )ÚBaseMatcher)ÚDescription)Úwrap_matcher)ÚMatcherzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtc @ sF e Zd Zdee ddfdd„Zdedefdd„Zd e ddfd
d„Z
dS )Ú 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
zHasString.__init__Úitemc C s | j t|ƒ¡S r )r ÚmatchesÚstr)r
r r r r Ú_matches s zHasString._matchesÚdescriptionc C s | d¡ | j¡ d S )Nzan object with str )Úappend_textÚappend_description_ofr )r
r r r r Údescribe_to s zHasString.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)Úhamcrest.core.base_matcherr Úhamcrest.core.descriptionr Ú"hamcrest.core.helpers.wrap_matcherr Úhamcrest.core.matcherr Ú
__author__Ú
__copyright__Ú__license__r r r r r r r Ú
s