
    e+                     j    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
dZ G d	 d
e      ZdedefdZy)    )Any)wrap_matcher)Matcher)tostringz
Chris RosezCopyright 2011 hamcrest.orgzBSD, see License.txtTc                   D    e Zd ZdeddfdZdedefdZdefdZ	defdZ
y)	EqualityWrappermatcherreturnNc                     || _         y Nr	   )selfr	   s     M/usr/lib/python3/dist-packages/hamcrest/library/integration/match_equality.py__init__zEqualityWrapper.__init__   s	        objc                 8    | j                   j                  |      S r   )r	   matches)r   r   s     r   __eq__zEqualityWrapper.__eq__   s    ||##C((r   c                     t        |       S r   )reprr   s    r   __str__zEqualityWrapper.__str__   s    Dzr   c                 ,    t        | j                        S r   )r   r	   r   s    r   __repr__zEqualityWrapper.__repr__   s    %%r   )__name__
__module____qualname__r   r   r   boolr   strr   r    r   r   r   r      s@     D )# )$ ) &# &r   r   r	   r
   c                 *    t        t        |             S )a<  Wraps a matcher to define equality in terms of satisfying the matcher.

    ``match_equality`` allows Hamcrest matchers to be used in libraries that
    are not Hamcrest-aware. They might use the equality operator::

        assert match_equality(matcher) == object

    Or they might provide a method that uses equality for its test::

        library.method_that_tests_eq(match_equality(matcher))

    One concrete example is integrating with the ``assert_called_with`` methods
    in Michael Foord's `mock <http://www.voidspace.org.uk/python/mock/>`_
    library.

    )r   r   r   s    r   match_equalityr#      s    " <011r   N)typingr   "hamcrest.core.helpers.wrap_matcherr   hamcrest.core.matcherr    hamcrest.core.string_descriptionr   
__author____copyright____license__
__unittestobjectr   r#   r!   r   r   <module>r-      sD     ; ) 5
-$
&f &2G 2 2r   