o (]^sã@sfddlmZddlmZddlmZddlmZdZdZ dZ Gdd „d ee ƒZ d ee fd d „Z d S)é)Ú BaseMatcher)Ú Description)Ú wrap_matcher)ÚMatcherzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtc@sFeZdZdeeddfdd„Zdedefdd„Zd e ddfd d „Z dS) Ú HasStringÚ str_matcherÚreturnNcCs ||_dS©N)r)Úselfr©r úC/usr/lib/python3/dist-packages/hamcrest/library/object/hasstring.pyÚ__init__ s zHasString.__init__ÚitemcCs|j t|ƒ¡Sr )rÚmatchesÚstr)r rr r r Ú_matchesszHasString._matchesÚ descriptioncCs| d¡ |j¡dS)Nzan object with str )Ú append_textÚappend_description_ofr)r rr r r Ú describe_toszHasString.describe_to) Ú__name__Ú __module__Ú __qualname__rrr ÚobjectÚboolrrrr r r r r srrcCs tt|ƒƒS)aRMatches 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') )rr)Úmatchr r r Ú has_strings rN)Úhamcrest.core.base_matcherrÚhamcrest.core.descriptionrÚ"hamcrest.core.helpers.wrap_matcherrÚhamcrest.core.matcherrÚ __author__Ú __copyright__Ú __license__rrrr r r r Ús