o
    (]^  ã                
   @   sÜ   d dl Z d dlmZmZmZmZ d dlmZ d dlm	Z	 dZ
dZdZdZdZed	ƒZeddedee deddfdd„ƒZeddededdfdd„ƒZddd„Zdedee deddfdd„Zddedee ddfdd„ZdS )é    N)ÚOptionalÚTypeVarÚcastÚoverload)ÚMatcher)ÚStringDescriptionzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtTÚTÚ ÚactualÚmatcherÚreasonÚreturnc                 C   ó   d S ©N© ©r
   r   r   r   r   ú;/usr/lib/python3/dist-packages/hamcrest/core/assert_that.pyÚassert_that   ó   r   Ú	assertionc                 C   r   r   r   ©r   r   r   r   r   r      r   c                 C   sV   t |tƒrt| ||d� dS t | tƒrt d t| ƒ¡¡ ttt	| ƒtt
|ƒd� dS )a”  Asserts that actual value satisfies matcher. (Can also assert plain
    boolean condition.)

    :param actual: The object to evaluate as the actual value.
    :param matcher: The matcher to satisfy as the expected condition.
    :param reason: Optional explanation to include in failure description.

    ``assert_that`` passes the actual value to the matcher for evaluation. If
    the matcher is not satisfied, an exception is thrown describing the
    mismatch.

    ``assert_that`` is designed to integrate well with PyUnit and other unit
    testing frameworks. The exception raised for an unmet assertion is an
    :py:exc:`AssertionError`, which PyUnit reports as a test failure.

    With a different set of parameters, ``assert_that`` can also verify a
    boolean condition:

    .. function:: assert_that(assertion[, reason])

    :param assertion:  Boolean condition to verify.
    :param reason:  Optional explanation to include in failure description.

    This is equivalent to the :py:meth:`~unittest.TestCase.assertTrue` method
    of :py:class:`unittest.TestCase`, but offers greater flexibility in test
    writing by being a standalone function.

    r   z"arg1 should be boolean, but was {}r   N)Ú
isinstancer   Ú_assert_matchÚwarningsÚwarnÚformatÚtypeÚ_assert_boolr   ÚboolÚstrr   r   r   r   r      s
   

c                 C   sN   |  | ¡s%tƒ }| |¡ d¡ |¡ d¡ | | |¡ | d¡ t|ƒ‚d S )Nz
Expected: z
     but: Ú
)Úmatchesr   Úappend_textÚappend_description_ofÚdescribe_mismatchÚAssertionError)r
   r   r   Údescriptionr   r   r   r   A   s   
ÿ
ùr   c                 C   s   | s
|sd}t |ƒ‚d S )NzAssertion failed)r%   r   r   r   r   r   L   s
   ýr   )r	   )Nr	   r   )r   Útypingr   r   r   r   Úhamcrest.core.matcherr   Ú hamcrest.core.string_descriptionr   Ú
__author__Ú__copyright__Ú__license__Ú
__unittestÚ__tracebackhide__r   r   r   r   r   r   r   r   r   r   Ú<module>   s"    "
% 