eqddlmZddlmZddlmZddlmZddlm Z ddl m Z ddl m Z dZd Zd ZGd d eeZd eee efde efdZy))Sized)Union) BaseMatcher) Description) hasmethod) wrap_matcher)MatcherzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtcbeZdZdeeddfdZdedefdZdede ddffd Z d e ddfd Z xZ S) HasLength len_matcherreturnNc||_y)N)r )selfr s C/usr/lib/python3/dist-packages/hamcrest/library/object/haslength.py__init__zHasLength.__init__s &itemcdt|dsy|jjt|S)N__len__F)rr matcheslen)rrs r_matcheszHasLength._matchess*y)''D 22rmismatch_descriptionctt| ||t|dr*|j dj t |yy)Nrz with length of )superr describe_mismatchr append_textappend_description_ofr)rrr __class__s rrzHasLength.describe_mismatchsE i07KL T9 % , ,-? @ V VWZ[_W` a &r descriptioncX|jdj|jy)Nzan object with length of )rrr )rr s r describe_tozHasLength.describe_tos# ;<RRSWScScdr) __name__ __module__ __qualname__r intrrboolrrrr" __classcell__)rs@rr r sb'GCL'T'3U3t3 beb;bSWb e{eterr matchr c*tt|S)aMMatches if ``len(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:`len` 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_length(greater_than(6)) has_length(5) )r r)r)s r has_lengthr+!s& \%( ))rN)collections.abcrtypingrhamcrest.core.base_matcherrhamcrest.core.descriptionrhamcrest.core.helpers.hasmethodr"hamcrest.core.helpers.wrap_matcherrhamcrest.core.matcherr __author__ __copyright__ __license__r r&r+rrr7sa!215;)  - $ e E"e$*eC-.*75>*r