File manager - Edit - /home/newsbmcs.com/public_html/static/img/logo/integration.tar
Back
match_equality.py 0000644 00000002453 15030211705 0010125 0 ustar 00 from typing import Any from hamcrest.core.helpers.wrap_matcher import wrap_matcher from hamcrest.core.matcher import Matcher from hamcrest.core.string_description import tostring __author__ = "Chris Rose" __copyright__ = "Copyright 2011 hamcrest.org" __license__ = "BSD, see License.txt" __unittest = True class EqualityWrapper(object): def __init__(self, matcher: Matcher) -> None: self.matcher = matcher def __eq__(self, obj: Any) -> bool: return self.matcher.matches(obj) def __str__(self) -> str: return repr(self) def __repr__(self) -> str: return tostring(self.matcher) def match_equality(matcher: Matcher) -> EqualityWrapper: """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. """ return EqualityWrapper(wrap_matcher(matcher)) __pycache__/__init__.cpython-310.pyc 0000644 00000000611 15030211705 0013204 0 ustar 00 o (]^� � @ s d Z ddlmZ dZdZdZdS )z8Utilities for integrating Hamcrest with other libraries.� )�match_equalityzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtN)�__doc__r � __author__� __copyright__�__license__� r r �G/usr/lib/python3/dist-packages/hamcrest/library/integration/__init__.py�<module> s __pycache__/match_equality.cpython-310.pyc 0000644 00000004012 15030211705 0014455 0 ustar 00 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 __init__.py 0000644 00000000327 15030211705 0006651 0 ustar 00 """Utilities for integrating Hamcrest with other libraries.""" from .match_equality import match_equality __author__ = "Jon Reid" __copyright__ = "Copyright 2011 hamcrest.org" __license__ = "BSD, see License.txt"
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings