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 |jddddS)Nrrrr log_namespaceztestfixtures.tests.test_twistedexpected)r rrrreventsrs r test_capturedzTestLogCapture.test_capturedsN/$'' !D111q!/2=^______rctj|d}tdddtddd|ddgddgdS)N)abfieldsz{a}, {b})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)Nr2r3zdon't look at me...rtype)index attribute) r r TypeErrorrr5rr6strr7rs rtest_check_failure_test_maximalz.TestLogCapture.test_check_failure_test_maximal/s/$'' #,-- - # KK " " " " " &'''""3y>>f"MMM          r9ctj|} td#tdYnxYwt t 5}|dddn #1swxYwYt|j j td| dS)Nr2r3r!) r rr>rr5rrraise_logged_failurerraisedvaluer7rrss 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!r3r2z what now?!r*) start_indexr!) r r ValueErrorrr5r>rrrBrrCrDr7rEs 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#1swxYwYdSNrMrNrOaentries 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 abcFrPr rrrr rr rRrs 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: []rOFrPrVrs r*test_order_doesnt_matter_extra_in_expectedz9TestLogCapture.test_order_doesnt_matter_extra_in_expectedxs/$'' %&&& ()))        MMq0112+,()#                      srgs........******++++++RRRRRRRRRRRR11111111 fhh[[[[[X[[[[[r