o
    (]^+  ã                   @   s²   d dl mZmZmZmZ d dlmZ 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ed
ƒZG dd„ deeeef  ƒZdeeee f deeeef  fdd„ZdS )é    )ÚAnyÚMappingÚTypeVarÚUnion)ÚBaseMatcher)ÚDescription)Ú	hasmethod)Úwrap_matcher)ÚMatcherzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtÚVc                   @   sN   e Zd Zdee ddfdd„Zdeeef defdd„Z	d	e
ddfd
d„ZdS )ÚIsDictContainingValueÚvalue_matcherÚreturnNc                 C   s
   || _ d S )N)r   )Úselfr   © r   úT/usr/lib/python3/dist-packages/hamcrest/library/collection/isdict_containingvalue.pyÚ__init__   s   
zIsDictContainingValue.__init__Úitemc                 C   s.   t |dƒr| ¡ D ]}| j |¡r dS q	dS )NÚvaluesTF)r   r   r   Úmatches)r   r   Úvaluer   r   r   Ú_matches   s   
ÿzIsDictContainingValue._matchesÚdescriptionc                 C   s   |  d¡ | j¡ d S )Nza dictionary containing value )Úappend_textÚappend_description_ofr   )r   r   r   r   r   Údescribe_to   s   
ÿz!IsDictContainingValue.describe_to)Ú__name__Ú
__module__Ú__qualname__r
   r   r   r   r   Úboolr   r   r   r   r   r   r   r      s    r   r   r   c                 C   s   t t| ƒƒS )aœ  Matches if dictionary contains an entry whose value satisfies a given
    matcher.

    :param value_match: The matcher to satisfy for the value, or an expected
        value for :py:func:`~hamcrest.core.core.isequal.equal_to` matching.

    This matcher iterates the evaluated dictionary, searching for any key-value
    entry whose value satisfies the given matcher. If a matching entry is
    found, ``has_value`` is satisfied.

    Any 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_value(equal_to('bar'))
        has_value('bar')

    )r   r	   )r   r   r   r   Ú	has_value!   s   r    N)Útypingr   r   r   r   Úhamcrest.core.base_matcherr   Úhamcrest.core.descriptionr   Úhamcrest.core.helpers.hasmethodr   Ú"hamcrest.core.helpers.wrap_matcherr	   Úhamcrest.core.matcherr
   Ú
__author__Ú__copyright__Ú__license__r   r   r    r   r   r   r   Ú<module>   s    .