id(ddlmZmZddlmZddlmZddlmZm Z m Z m Z ddl mZmZeZGddeZdS) )Logger formatEvent)Failure)TestCase)compare ShouldRaiseStringComparison ShouldAssert) LogCaptureINFOcVeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd S)TestLogCapturectj|}tdd|t dfdS)Ner, {greeting}higreetinger, hi)r makeloginfocheckr selfcaptures T/opt/cloudlinux/venv/lib/python3.11/site-packages/testfixtures/tests/test_twisted.py test_simplezTestLogCapture.test_simple sE/$'' !D111 tX&'''''ctj|}tddt |jdksJt |jddddS) Nrrrr log_namespaceztestfixtures.tests.test_twistedexpected)r rrrleneventsrrs r test_capturedzTestLogCapture.test_capturedsi/$'' !D1117>""a''''q!/2=^______rctj|d}tdddtddd|ddgddgdS)N)abfieldsz{a}, {b}r )r rrrrrs r test_fieldszTestLogCapture.test_fieldsst/$z::: qA&&& qA&&& F F     rctj|tf}tdd|ddS)Nr*rrrr)r rrrrrrs r test_fieldzTestLogCapture.test_field!sG/$ ~>>> !D111 hrctj|} td#tdYnxYw|d|dS)Nall gone wrongoh dear)r r Exceptionrfailurecheck_failure_textflushLoggedErrorsrs rtest_check_failure_test_minimalz.TestLogCapture.test_check_failure_test_minimal&ss/$'' #,-- - # KK " " " " """#3444      %Achtj|} td#tdYnxYwtd|ttdd||dS)Nr3r4zdon't look at me...rtype)index attribute) r r TypeErrorrr6rr7strr8rs rtest_check_failure_test_maximalz.TestLogCapture.test_check_failure_test_maximal/s/$'' #,-- - # KK " " " " " &'''""3y>>f"MMM          r:ctj|} td#tdYnxYwt t 5}|dddn #1swxYwYt|j j td| dS)Nr3r4r") r rr?rr6rrraise_logged_failurerraisedvaluer8rrss rtest_raise_logged_failurez(TestLogCapture.test_raise_logged_failure:s/$'' #,-- - # KK " " " " "  ! ! +Q  ( ( * * * + + + + + + + + + + + + + + +3C)D)DEEEE      s%AA;;A?A?ctj|} td#tdYnxYw t d#tdYnxYwt t5}|ddddn #1swxYwYt|j j t d| dS)Nzboom!r4r3z what now?!r ) start_indexr") r r ValueErrorrr6r?rrrCrrDrEr8rFs rtest_raise_later_logged_failurez.TestLogCapture.test_raise_later_logged_failureEs)/$'' #W%% % # KK " " " " " &,-- - & KK % % % % %  ! ! 8Q  ( (Q ( 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 83C)D)DEEEE      s'%AAA4 B..B25B2c@tj|}tdtdtd|t t dft dft dfddS)NFailed to send BARSent FOO, length 1234Sent 1 MessageszSent FOO, length \d+F order_matters)r rrrrr Srs rtest_order_doesnt_matter_okz*TestLogCapture.test_order_doesnt_matter_okTs/$'' %&&& ())) "### 1+,, - ' ( $ %      rctj|}tdtdtdt d5|t tdft dft dfdddddS#1swxYwYdSNrNrOrPaentries not as expected: expected and found: [(, 'Failed to send BAR'), (, 'Sent 1 Messages')] expected but not found: [(, )] other entries: [(, 'Sent FOO, length 1234')]zSent FOO, length abcFrQr rrrr rr rSrs r test_order_doesnt_matter_failurez/TestLogCapture.test_order_doesnt_matter_failure`/$'' %&&& ())) "###  ;      MMq/001+,()#                      2, 'Failed to send BAR'), (, )] expected but not found: [(, 'Sent 1 Messages')] other entries: []rPFrQrWrs r*test_order_doesnt_matter_extra_in_expectedz9TestLogCapture.test_order_doesnt_matter_extra_in_expectedxs/$'' %&&& ()))        MMq0112+,()#                      srhs........******++++++RRRRRRRRRRRR11111111 fhh[[[[[X[[[[[r