
    e]              
           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       Zedd
ededdfd       ZddZdedee   deddfdZddedee   ddfdZy)    N)OptionalTypeVarcastoverload)Matcher)StringDescriptionzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtTTactual_or_assertionmatcherreasonreturnc                      y N r
   r   r   s      ;/usr/lib/python3/dist-packages/hamcrest/core/assert_that.pyassert_thatr              c                      y r   r   )r
   r   s     r   r   r      r   r   c                    t        |t              rt        | ||       yt        | t              r-t        j                  dj                  t        |                    t        t        t        |       t        t        |             y)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.

    )actualr   r   z"arg1 should be boolean, but was {}	assertionr   N)
isinstancer   _assert_matchwarningswarnformattype_assert_boolr   boolstrr   s      r   r   r      s^    : '7#0'&Q)73MM>EEdK^F_`atD*=>tCQXGYZr   r   c                    |j                  |       svt               }|j                  |      j                  d      j                  |      j                  d       |j	                  | |       |j                  d       t        |      y )Nz
Expected: z
     but: 
)matchesr   append_textappend_description_ofdescribe_mismatchAssertionError)r   r   r   descriptions       r   r   r   A   su    ??6"')'33NCYY	

+n
%!!&+6%[)) #r   r   c                 &    | s|sd}t        |      y )NzAssertion failed)r*   r   s     r   r!   r!   L   s    'FV$$ 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   <module>r6      s     4 4 ) >
-$
 CL 
Q  S RV  
 
T 3   
"[J*! *gaj *# *$ *%D %(3- %4 %r   