Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/zope/interface/tests/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyc


Kc@s-dZddlZddlmZmZmZddlmZmZddlmZddl	Z	dZ
y'ddlmZddd	YZ
Wnek
rnXd
ddYZee	jZdefd
YZdefdYZeefZdZedkr)ejddndS(sTests for advice

This module was adapted from 'protocols.tests.advice', part of the Python
Enterprise Application Kit (PEAK).  Please notify the PEAK authors
(pje@telecommunity.com and tsarna@sarna.org) if bugs are found or
Zope-specific changes are required, so that the PEAK version of this module
can be kept in sync.

PEAK is a Python application framework that interoperates with (but does
not require) Zope 3 and Twisted.  It provides tools for manipulating UML
models, object-relational persistence, aspect-oriented programming, and more.
Visit the PEAK home page at http://peak.telecommunity.com for more information.

$Id: test_advice.py 110736 2010-04-11 10:59:30Z regebro $
iN(tTestCaset	makeSuitet	TestSuite(taddClassAdvisortdetermineMetaclass(tgetFrameInfocs fd}t|dS(Ncsj|f|gS(N(tappend(tklass(tvaluetlog(sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pytpong's(R(R	RR
((R	RsD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pytping%s(t	ClassTypetClassicClasscBs eZeZeejZRS((t__name__t
__module__Rt
__metaclass__Rtsyst	_getframetclassLevelFrameInfo(((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyR
0st
NewStyleClasscBs eZeZeejZRS((RRttypeRRRRR(((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyR6st
FrameInfoTestcBs>eZeejZdZdZdZdZ	RS(cCsYt\}}}}|j|dx0|j||fD]}|j|tkq5WdS(Ntmodule(tmoduleLevelFrameInfotassertEqualst__dict__tassert_tglobals(tselftkindRtf_localst	f_globalstd((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pytcheckModuleInfo@scCsotj\}}}}|j|d|j|tjkx-|j|fD]}|j|tkqKWdS(Ntclass(R
RRRRR(RRRRR R!((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pytcheckClassicClassInfoFs
cCsYtj\}}}}|j|dx-|j|fD]}|j|tkq5WdS(NR#(RRRRRR(RRRRR R!((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pytcheckNewStyleClassInfoNscCsxttj\}}}}|j|d|j|tkx-|j|fD]}|j|tkqTWdS(Ns
function call(RRRRRtlocalsRR(RRRRR R!((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyt
checkCallInfoUs
(
RRRRRRR"R$R%R'(((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyR<s
			tAdviceTestscBs>eZdZdZdZdZdZdZRS(csgdtffdY}x-dD]%}|jt|t|\}q)W|jd|fd|gfd|ggfgdS(NtFoocs/eZedededRS(iii(RRR((R	(sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyR)as

iii(iii(tobjectRt
isinstancetlistR(RR)ti((R	sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyt
checkOrder_s

cCs5ytgdWntk
r$n
XtddS(Nis.Should have detected advice outside class body(RtSyntaxErrortAssertionError(R((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pytTODOcheckOutsidems
cCsOtjdkrdSdttfdY}|\}|j|jtkdS(NitaTypecBseZegdRS(i(RRR(((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyR2{s(Rt
hexversionRRt	__class__(RR2((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pytcheckDoubleTypexs
	csUdtfdYdffdY}|\}|j|jkdS(NtMcBseZRS((RR(((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyR6stCcseZZegdRS(i(RRRR((R6(sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyR7s(RRR4(RR7((R6sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pytcheckSingleExplicitMetas	csdtfdYdtfdYddfdY}ddfdY}yd	||fd
Y}Wntk
rn
Xtddfd
Yd	||ffdY}|jt|t|\}|jt|dS(NtM1cBseZRS((RR(((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyR9stM2cBseZRS((RR(((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyR:stB1cseZZRS((RRR((R9(sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyR;stB2cseZZRS((RRR((R:(sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyR<sR7cBseZegdRS(i(RRR(((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyR7ss(Should have gotten incompatibility errortM3cBseZRS((RR(((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyR=scseZZegdRS(i(RRRR((R=(sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyR7s(((Rt	TypeErrorR0RR+R,(RR;R<R7((R=R9R:sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pytcheckMixedMetass
	csRdtfdYdtffdY}|jt|tfdS(NtmetametacBseZRS((RR(((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyR@stmetacseZZRS((RRR((R@(sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyRAs(RRR(RRA((R@sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pytcheckMetaOfClasss(RRR.R1R5R8R?RB(((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyR(]s				
	cCsAtjddkr9tgtD]}t|d^qSgSdS(Nit2tcheck(RtversionRtTestClassesR(tt((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyt
test_suites&t__main__tdefaultTestRH(((t__doc__tunittestRRRtzope.interface.adviceRRRRRttypesRR
tImportErrorRRRRR(RFRHRtmain(((sD/usr/lib/python2.7/dist-packages/zope/interface/tests/test_advice.pyt<module>s&	
!T