+
    bVi                        ^ RI HtHtHtHtHt ^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt R
tRtRt]! R4      t ! R R]],          4      tRR R llt]R R l4       t]R R l4       t]R R l4       tR tR# )    )AnyMappingTypeVarUnionoverload)described_as)anything)BaseMatcher)AllOfDescription)wrap_matcher)Matcher)StringDescriptionz
Chris RosezCopyright 2011 hamcrest.orgzBSD, see License.txtVc                   n   a  ] tR t^t o V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltR	 tR
t	V t
R# )IsObjectWithPropertyc                :   < V ^8  d   QhRS[ RS[S[,          RR/# )   property_namevalue_matcherreturnN)strr   r   )format__classdict__s   "E/usr/lib/python3/dist-packages/hamcrest/library/object/hasproperty.py__annotate__!IsObjectWithProperty.__annotate__   s&     + +c +'!* + +    c                    Wn         W n        R # Nr   r   )selfr   r   s   &&&r   __init__IsObjectWithProperty.__init__   s    **r   c                &   < V ^8  d   QhRS[ RS[/# )r   itemr   )objectbool)r   r   s   "r   r   r      s     1 1V 1 1r   c                    Vf   R# \        WP                  4      '       g   R# \        WP                  4      pV P                  P	                  V4      # )NF)hasattrr   getattrr   matches)r#   r'   values   && r   _matchesIsObjectWithProperty._matches   sE    <t//00001!!))%00r   c                $   < V ^8  d   QhRS[ RR/# )r   descriptionr   Nr   )r   r   s   "r   r   r   "   s     O O{ Ot Or   c                    VP                  R 4      P                  V P                  4      P                  R4      P                  V P                  4       R# )zan object with a property 'z' matching N)append_textr   append_description_ofr   )r#   r2   s   &&r   describe_to IsObjectWithProperty.describe_to"   s@     =>JJ	

+m
$%:%:4;M;M%Nr   c                *   < V ^8  d   QhRS[ RS[RR/# )r   r'   mismatch_descriptionr   N)r(   r   )r   r   s   "r   r   r   '   s(     J Jf JK JTX Jr   c                   Vf   VP                  R4       R # \        WP                  4      '       gK   VP                  V4      P                  R4      P                  V P                  4      P                  R4       R # VP                  R4      P                  V P                  4      P                  R4       \	        WP                  4      pV P
                  P                  W24       R # )Nzwas Nonez did not have the z	 propertyz	property  )r4   r+   r   r5   r,   r   describe_mismatch)r#   r'   r9   r.   s   &&& r   r<   &IsObjectWithProperty.describe_mismatch'   s    < ,,Z8t//00 66t<HH$##D$6$67K8P((5KK	

+c
001,,UIr   c                N    \        4       pV P                  V4       \        V4      # r!   )r   r6   r   )r#   ds   & r   __str__IsObjectWithProperty.__str__8   s!    1vr   r"   N)__name__
__module____qualname____firstlineno__r$   r/   r6   r<   r@   __static_attributes____classdictcell__)r   s   @r   r   r      s;     + +1 1O O
J J" r   r   Nc                    V ^8  d   QhR\         R\        R\        \        ,          \        3,          R\        \        ,          /# )r   namematchNr   )r   r   r   r   r(   )r   s   "r   r   r   >   s6     < <s <5wqz1)<#= <QW <r   c                H    Vf   \        4       p\        V \        V4      4      # )aY  Matches if object has a property with a given name whose value satisfies
a given matcher.

:param name: The name of the property.
:param match: Optional matcher to satisfy.

This matcher determines if the evaluated object has a property with a given
name. If no such property is found, ``has_property`` is not satisfied.

If the property is found, its value is passed 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.

If the ``match`` argument is not provided, the
:py:func:`~hamcrest.core.core.isanything.anything` matcher is used so that
``has_property`` is satisfied if a matching property is found.

Examples::

    has_property('name', starts_with('J'))
    has_property('name', 'Jon')
    has_property('name')

)r	   r   wrap_shortcut)rI   rJ   s   &&r   has_propertyrM   >   s"    6 }
mE&:;;r   c                ~    V ^8  d   QhR\         \        \        ,          \        3,          R\        \        ,          /# r   keys_valuematchersr   )r   r   r   r   )r   s   "r   r   r   a   s+      wqz1})= '#, r   c                      R # r!    rP   s   ,r   has_propertiesrT   `       r   c                    V ^8  d   QhR\         \        \        \        \        ,          \        3,          3,          R\        \
        ,          /# rO   )r   r   r   r   r   r   )r   s   "r   r   r   g   s6      wsE'!*a-4H/H'I gVYl r   c                     R # r!   rR   rS   s   &r   rT   rT   f   rU   r   c                F    V ^8  d   QhR\         R\        \         ,          /# rO   )r   r   )r   s   "r   r   r   m   s        r   c                      R # r!   rR   rS   s   *r   rT   rT   l   rU   r   c                 Z   \        V 4      ^8X  d6    V ^ ,          P                  4       pV F  p\        W#,          4      W#&   K  	  M\        V 4      ^,          '       d   \	        R4      h/ p\        \        \        V 4      ^,          4      4       F3  p\        V ^V,          ^,           ,          4      W ^V,          ,          &   K5  	  VP                  4        F  w  r5\        V4      W#&   K  	  \        V4      ^8  d   \        4       P                  R4      p\        \        VP                  4       4      4       Fa  w  pw  rVP                  V4      P                  R4      P                  V	4       V\        V4      ^,
          8  g   KP  VP                  R4       Kc  	  \        \        V4      \        \        VP                  4       4       UU	u. uF  w  r\!        W4      NK  	  up	pRRRR	/ 4      # VP#                  4       w  r\!        W4      #   \         d    \	        R4      hi ; iu up	pi )
a  Matches if an object has properties satisfying all of a dictionary
of string property names and corresponding value matchers.

:param matcher_dict: A dictionary mapping keys to associated value matchers,
    or to expected values for
    :py:func:`~hamcrest.core.core.isequal.equal_to` matching.

Note that the keys must be actual keys, not matchers. Any value argument
that is not a matcher is implicitly wrapped in an
:py:func:`~hamcrest.core.core.isequal.equal_to` matcher to check for
equality.

Examples::

    has_properties({'foo':equal_to(1), 'bar':equal_to(2)})
    has_properties({'foo':1, 'bar':2})

``has_properties`` also accepts a list of keyword arguments:

.. function:: has_properties(keyword1=value_matcher1[, keyword2=value_matcher2[, ...]])

:param keyword1: A keyword to look up.
:param valueMatcher1: The matcher to satisfy for the value, or an expected
    value for :py:func:`~hamcrest.core.core.isequal.equal_to` matching.

Examples::

    has_properties(foo=equal_to(1), bar=equal_to(2))
    has_properties(foo=1, bar=2)

Finally, ``has_properties`` also accepts a list of alternating keys and their
value matchers:

.. function:: has_properties(key1, value_matcher1[, ...])

:param key1: A key (not a matcher) to look up.
:param valueMatcher1: The matcher to satisfy for the value, or an expected
    value for :py:func:`~hamcrest.core.core.isequal.equal_to` matching.

Examples::

    has_properties('foo', equal_to(1), 'bar', equal_to(2))
    has_properties('foo', 1, 'bar', 2)

zHsingle-argument calls to has_properties must pass a dict as the argumentz'has_properties requires key-value pairszan object with properties z
 matching z and describe_all_mismatchesTdescribe_matcher_in_mismatchF)lencopyrL   AttributeError
ValueErrorrangeintitemsr   r4   	enumeratesortedr5   r   r   r   rM   popitem)
rP   kv_args	base_dictkeyindexr.   r2   ir   property_value_matchers
   *,        r   rT   rT   q   s   \ !#	*1-224I !.y~!>	 ! !"Q&&FGG	3s#56:;<E7D"1u9q=18IU34 =
 mmo
&u-	 & 9~')556RS:CF9??K\D]:^6A6--m<HH##$:;3y>A%%''0 ;_  BH	HYAZAZ= !GAZ
 )- .3

 
	
 1:0A0A0C-MBBM  	Z 	8s   3H H'H$r!   )typingr   r   r   r   r   hamcrestr   hamcrest.corer	   hamcrest.core.base_matcherr
   hamcrest.core.core.allofr   hamcrest.core.descriptionr   "hamcrest.core.helpers.wrap_matcherr   rL   hamcrest.core.matcherr    hamcrest.core.string_descriptionr   
__author____copyright____license__r   r(   r   rM   rT   rR   r   r   <module>ry      s    9 9 ! " 2 * 1 L ) >
-$CL(;v. (V<D 
 

 
 

 
 
YCr   