U
    ôbÛV¨  ã                   @   sD   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	d
„ Z
dS )é    )Útostring)Úwrap_matcherz
Chris RosezCopyright 2011 hamcrest.orgzBSD, see License.txtTc                   @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
ÚEqualityWrapperc                 C   s
   || _ d S ©N©Úmatcher)Úselfr   © r	   úM/usr/lib/python3/dist-packages/hamcrest/library/integration/match_equality.pyÚ__init__   s    zEqualityWrapper.__init__c                 C   s   | j  |¡S r   )r   Zmatches)r   Úobjectr	   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__   s    zEqualityWrapper.__repr__N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r	   r	   r	   r
   r   
   s   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)Z hamcrest.core.string_descriptionr   Z"hamcrest.core.helpers.wrap_matcherr   Ú
__author__Z__copyright__Z__license__Z
__unittestr   r   r   r	   r	   r	   r
   Ú<module>   s   