Your IP : 216.73.216.196


Current Path : /opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyc

�
R�Xc@s�ddlmZmZmZmZmZddlmZddl	m
Z
e
�Ze
d�Ze
d�Z
e
d�Zdefd��YZd	S(
i����(tlog_capturetcomparet
Comparisont
LogCapturetShouldRaise(tTestCase(t	getLoggertonettwos	one.childtTestLog_CapturecBs�eZedd�ed�e�d����Zd�Ze�d��Zd�Zd�Zd�Zd	�Z	d
�Z
d�Zd�Zd
�Z
d�Zd�ZRS(Rs	one.childRcCs�tjd�tjd�tjd�tjd�|jddd
d�|jdd�|jdd�t|jtd
�td
�g�dS(Nt1t2t3t4troottINFORRs	one.childslogging.LogRecord(RRR
(RRR(RRR(s	one.childRR
(RRR(s	one.childRR
(RRR(s	one.childRR
(	RtinfoRRtchildtcheckRtrecordstC(tselftl1tl2tl3((sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyttest_loggings$



		cs�t�}td�}|j}|j}z�|j}|jd�|j}|jd�td�t��fd���}|��j|jd��j|jd��j|j|��j|j|�Wd|j|�|j|�XdS(NRi1iEcsvt�}|jd��j|jd�td�}�j|jd�|jd�|jdd�|jd	�dS(
NR
iRRRR(RRR
(RRR(RRR(RRtassertEqualtlevelR(RRRR(R(sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyttest_method=s	

(RthandlersRtsetLevelRR(RRRtbefore_roottbefore_childtold_root_leveltold_child_levelR((RsT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyttest_uninstall_properly2s$	

	
	
	
cCs|jt|t��dS(N(t
failUnlesst
isinstanceR(Rtl((sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyt!test_decorator_returns_logcaptureZscsit���j}zFt�g�_}t��fd��}|�t�j|�Wd|�_XdS(Ncs�jd�|jd�dS(NtduringRR(RRR((RR(R&(tlogger(sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyRhs
(RRtobjectRR(RtoriginaltstartR((R)sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyttest_remove_existing_handlers`s		cCsSddlm}m}t�}|j�|j||k�|j||k�dS(Ni����(t	_handlerst_handlerList(tloggingR.R/Rt	uninstalltassertFalse(RR.R/tcapture((sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyttest_clear_global_statets
	
csttd��t�jt�tddt��fd��}t��}|�WdQX|j�t�jt�dS(NRt	propagatecs�jd�|jd�dS(Ns
a log messageRR(RRs
a log message(RR(R&(R)(sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyR�s
(RRR5tTrueRtFalseRR(RRt
global_log((R)sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyttest_no_propogate{s!

cCs9tdd��}t�jd�WdQX|jd�dS(	Nt
attributestfuncNametprocessNamesoh haittest_different_attributestMainProcess(R;R<(R=R>(RRRR(Rtlog((sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyR=�scCs<tdd��}t�jdd�WdQX|jd�dS(NR:tmsgtlolwutsoh %sthai(R@RA(soh %sN(RRRRtNone(RR?((sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyttest_missing_attribute�sc
CsZtddg��&}t�jtdddd��WdQX|jtdddd��dS(NR:R@tfootbartbaztbob(RRRtdictR(RR?((sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyttest_single_attribute�s%c
CsZd�}td|��&}t�jtdddd��WdQX|jtdd��dS(NcSsd�|jj�D�S(NcSs+i|]!\}}|dkr||�qS(RG((t.0tktv((sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pys
<dictcomp>�s		(R@titems(trecord((sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pytextract_msg�sR:RERFRGRH(RRRRIR(RRPR?((sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyt"test_callable_instead_of_attribute�s
	%c
CsHtdd��&}t�jddtdd��WdQX|jd�dS(NR:R@REtextraRF(R@RE(NRF(RRRRCRIR(RR?((sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyttest_msg_is_none�s%c	Csat��}t�jd�WdQXtt��}|jd�WdQXtt|j�dd�dS(Nsoh haiRRsoh noeztexpectedstsequence not as expected:

same:
()

expected:
(('root', 'INFO', 'oh noez'),)

actual:
(('root', 'INFO', 'oh hai'),)(RRsoh noez(	RRRRtAssertionErrorRRtstrtraised(RR?ts((sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyttest_normal_check�sc	Csgtdt��}t�jd�WdQXtt��}|jd�WdQXtt|j	�dd�dS(	Ntrecursive_checksoh haiRRsoh noezRTs,sequence not as expected:

same:
()

expected:
(('root', 'INFO', 'oh noez'),)

actual:
(('root', 'INFO', 'oh hai'),)

While comparing [0]: sequence not as expected:

same:
('root', 'INFO')

expected:
('oh noez',)

actual:
('oh hai',)

While comparing [0][2]: 'oh noez' (expected) != 'oh hai' (actual)(RRsoh noez(
RR6RRRRURRRVRW(RR?RX((sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyttest_recursive_check�s(t__name__t
__module__RRR#R'R-R4R9R=RDRJRQRSRYR[(((sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyR	s		(							
		N(ttestfixturesRRRRRRtunittestRR0RRRRRR	(((sT/opt/alt/python27/lib/python2.7/site-packages/testfixtures/tests/test_log_capture.pyt<module>s(