Current File : //lib/python3/dist-packages/hamcrest/library/integration/__pycache__/match_equality.cpython-312.pyc |
�
���e+ � �j � d dl mZ d dlmZ d dlmZ d dlmZ dZdZ dZ
dZ G d � d
e� Z
dede
fd
�Zy)� )�Any)�wrap_matcher)�Matcher)�tostringz
Chris RosezCopyright 2011 hamcrest.orgzBSD, see License.txtTc �D � e Zd Zdeddfd�Zdedefd�Zdefd�Z defd�Z
y) �EqualityWrapper�matcher�returnNc � � || _ y �N�r )�selfr s �M/usr/lib/python3/dist-packages/hamcrest/library/integration/match_equality.py�__init__zEqualityWrapper.__init__ s � ���� �objc �8 � | j j |� S r )r �matches)r r s r �__eq__zEqualityWrapper.__eq__ s � ��|�|�#�#�C�(�(r c � � t | � S r )�repr�r s r �__str__zEqualityWrapper.__str__ s � ��D�z�r c �, � t | j � S r )r r r s r �__repr__zEqualityWrapper.__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 � �"