o
    (]^î  ã                   @   sj   d dl mZ d dlmZ d dlmZ d dlmZ dZdZ	dZ
G dd	„ d	ee ƒZd
edee fdd„ZdS )é    )ÚBaseMatcher)ÚDescription)Ú	hasmethod)ÚMatcherzRomilly CockingzCopyright 2011 hamcrest.orgzBSD, see License.txtc                   @   s:   e Zd Zddd„Zdedefdd„Zdeddfd	d
„ZdS )ÚStringContainsInOrderÚreturnNc                 G   s.   |D ]}t |tƒst| jjd ƒ‚q|| _d S )Nz requires string arguments)Ú
isinstanceÚstrÚ	TypeErrorÚ	__class__Ú__name__Ú
substrings)Úselfr   Ú	substring© r   úM/usr/lib/python3/dist-packages/hamcrest/library/text/stringcontainsinorder.pyÚ__init__   s
   
ÿ
zStringContainsInOrder.__init__Úitemc                 C   s<   t |dƒsdS d}| jD ]}| ||¡}|dkr dS qdS )NÚfindFr   éÿÿÿÿT)r   r   r   )r   r   Ú
from_indexr   r   r   r   Ú_matches   s   

ÿzStringContainsInOrder._matchesÚdescriptionc                 C   s   |  ddd| j¡ d S )Nza string containing z, z	 in order)Úappend_listr   )r   r   r   r   r   Údescribe_to   s   z!StringContainsInOrder.describe_to)r   N)	r   Ú
__module__Ú__qualname__r   r	   Úboolr   r   r   r   r   r   r   r      s    

r   r   r   c                  G   s   t | Ž S )a  Matches if object is a string containing a given list of substrings in
    relative order.

    :param string1,...:  A comma-separated list of strings.

    This matcher first checks whether the evaluated object is a string. If so,
    it checks whether it contains a given list of strings, in relative order to
    each other. The searches are performed starting from the beginning of the
    evaluated string.

    Example::

        string_contains_in_order("bc", "fg", "jkl")

    will match "abcdefghijklm".

    )r   )r   r   r   r   Ústring_contains_in_order    s   r   N)Úhamcrest.core.base_matcherr   Úhamcrest.core.descriptionr   Úhamcrest.core.helpers.hasmethodr   Úhamcrest.core.matcherr   Ú
__author__Ú__copyright__Ú__license__r	   r   r   r   r   r   r   Ú<module>   s    