G_andZddlmZddlmZddlmZGddeZGdd eZ Gd d eZ y ) z! Tests for hyperlink.test.common )Any)TestCase)HyperlinkTestCaseceZdZdZy)_ExpectedException9An exception used to test HyperlinkTestCase.assertRaises.N__name__ __module__ __qualname____doc__.raisesExpected!s   f~ .$ $rrT)keyword)rr%N)r assertRaisesr assertEqual)rr$r#s @rtest_assertRaisesWithCallablez+TestHyperlink.test_assertRaisesWithCallablesR  % (( 4 )  y$.?'@&ABrcjd} |jjt|y#t$rYywxYw)zWhen given a callable that raises an unexpected exception, HyperlinkTestCase.assertRaises raises that exception. ctr)rr!r"s rdoesNotRaiseExpectedz\TestHyperlink.test_assertRaisesWithCallableUnexpectedException..doesNotRaiseExpected2s& &rNrr&rr)rr,s r0test_assertRaisesWithCallableUnexpectedExceptionz>TestHyperlink.test_assertRaisesWithCallableUnexpectedException+s: '     , ,"$8 $    & 22cjd} |jjt|y#t$rYywxYw)zHyperlinkTestCase.assertRaises raises an AssertionError when given a callable that, when called, does not raise any exception. cyrrr+s r doesNotRaisezMTestHyperlink.test_assertRaisesWithCallableDoesNotRaise..doesNotRaiseDs rNrr&rAssertionError)rr2s r)test_assertRaisesWithCallableDoesNotRaisez7TestHyperlink.test_assertRaisesWithCallableDoesNotRaise=s5      , ,-? N   r/c|jjt5}t#1swYnxYw|jt j ty)a HyperlinkTestCase.assertRaises does not raise an AssertionError when used as a context manager with a suite that raises the expected exception. The context manager stores the exception instance under its `exception` instance variable. N)rr&r assertTrue isinstance exception)rcms rtest_assertRaisesContextManagerz-TestHyperlink.test_assertRaisesContextManagerMsN - -.@ A %R$ $ % %  r||%7 8 s'0c |jjt5t#1swYyxYw#t$rYywxYw)zWhen used as a context manager with a block that raises an unexpected exception, HyperlinkTestCase.assertRaises raises that unexpected exception. Nr-rs r2test_assertRaisesContextManagerUnexpectedExceptionz@TestHyperlink.test_assertRaisesContextManagerUnexpectedException\sC $$112DE +** + +#   s4(144 AAc |jjt5 dddy#1swYyxYw#t$rYywxYw)zHyperlinkTestcase.assertRaises raises an AssertionError when used as a context manager with a block that does not raise any exception. Nr3rs r+test_assertRaisesContextManagerDoesNotRaisez9TestHyperlink.test_assertRaisesContextManagerDoesNotRaiseisE $$112DE       s#8,8588 AAN) r r r rrr(r.r5r;r=r?rrrrrs)%7C&$    rrN) rtypingrunittestrcommonr ExceptionrrrrrrrDs?%DDD9DcHcr