PHP WebShell
Текущая директория: /usr/lib/python3/dist-packages/hamcrest/library/collection/__pycache__
Просмотр файла: issequence_onlycontaining.cpython-310.pyc
o
(]^1 � @ s� d dl mZmZmZ d dlmZ d dlmZ d dlm Z d dl
mZ d dlm
Z
dZdZd Zed
�ZG dd� deee �Zd
ee
e ef de
ee fdd�ZdS )� )�Sequence�TypeVar�Union)�BaseMatcher)�any_of)�Description)�wrap_matcher)�MatcherzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txt�Tc @ sJ e Zd Zdee ddfdd�Zdee defdd�Zd e ddfd
d�Z
dS )�IsSequenceOnlyContaining�matcher�returnNc C s
|| _ d S )N)r )�selfr � r �W/usr/lib/python3/dist-packages/hamcrest/library/collection/issequence_onlycontaining.py�__init__ s
z!IsSequenceOnlyContaining.__init__�itemc C sT zt |�}t|�dkrW dS |D ]}| j�|�s W dS qW dS ty) Y dS w )Nr FT)�list�lenr �matches� TypeError)r r �sequence�elementr r r �_matches s ��z!IsSequenceOnlyContaining._matches�descriptionc C s |� d��| j� d S )Nz%a sequence containing items matching )�append_text�append_description_ofr )r r r r r �describe_to s
�z$IsSequenceOnlyContaining.describe_to)�__name__�
__module__�__qualname__r r
r r �boolr r r r r r r r s r �itemsr
c G s( g }| D ] }|� t|�� qtt|� �S )a� Matches if each element of sequence satisfies any of the given matchers.
:param match1,...: A comma-separated list of matchers.
This matcher iterates the evaluated sequence, confirming whether each
element satisfies any of the given matchers.
Example::
only_contains(less_than(4))
will match ``[3,1,2]``.
Any argument that is not a matcher is implicitly wrapped in an
:py:func:`~hamcrest.core.core.isequal.equal_to` matcher to check for
equality.
)�appendr r r )r"