o
    (]^+  ã                   @   sf   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
„ d
eƒZdedefdd„ZdS )é    )ÚAny)Úwrap_matcher)ÚMatcher)Útostringz
Chris RosezCopyright 2011 hamcrest.orgzBSD, see License.txtTc                   @   sL   e Zd Zdeddfdd„Zdedefdd„Zdefd	d
„Z	defdd„Z
dS )ÚEqualityWrapperÚmatcherÚreturnNc                 C   s
   || _ d S ©N©r   )Úselfr   © r   úM/usr/lib/python3/dist-packages/hamcrest/library/integration/match_equality.pyÚ__init__   ó   
zEqualityWrapper.__init__Úobjc                 C   s   | j  |¡S r	   )r   Úmatches)r   r   r   r   r   Ú__eq__   s   zEqualityWrapper.__eq__c                 C   s   t | ƒS r	   )Úrepr©r   r   r   r   Ú__str__   s   zEqualityWrapper.__str__c                 C   s
   t | jƒS r	   )r   r   r   r   r   r   Ú__repr__   r   zEqualityWrapper.__repr__)Ú__name__Ú
__module__Ú__qualname__r   r   r   Úboolr   Ústrr   r   r   r   r   r   r      s
    r   r   r   c                 C   s   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
   r   r   r   Úmatch_equality   s   r   N)Útypingr   Ú"hamcrest.core.helpers.wrap_matcherr   Úhamcrest.core.matcherr   Ú hamcrest.core.string_descriptionr   Ú
__author__Ú__copyright__Ú__license__Ú
__unittestÚobjectr   r   r   r   r   r   Ú<module>   s    