File: //lib/python3/dist-packages/hamcrest/library/integration/__pycache__/match_equality.cpython-310.pyc
o
(]^+ � @ sf d dl mZ d dlmZ d dlmZ d dlmZ dZdZ dZ
dZG d d
� d
e�Z
dede
fd
d�ZdS )� )�Any)�wrap_matcher)�Matcher)�tostringz
Chris RosezCopyright 2011 hamcrest.orgzBSD, see License.txtTc @ sL e Zd Zdeddfdd�Zdedefdd�Zdefd d
�Z defdd�Z
dS )
�EqualityWrapper�matcher�returnNc C s
|| _ d S �N�r )�selfr � r �M/usr/lib/python3/dist-packages/hamcrest/library/integration/match_equality.py�__init__ �
zEqualityWrapper.__init__�objc C s | j �|�S r )r �matches)r r r r r
�__eq__ s zEqualityWrapper.__eq__c C s t | �S r )�repr�r r r r
�__str__ s zEqualityWrapper.__str__c C s
t | j�S r )r r r r r r
�__repr__ r zEqualityWrapper.__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