ϪfTndZddlZddlmZddlmZddlmZmZm Z m Z m Z de de de fd Z Gd d eZ y) zW Tests for L{twisted.web._stan} portion of the L{twisted.web.template} implementation. N)NoReturn)TestCase)CDATACharRefComment FlattenableTagakwreturnc$td|i|S)z( Produce a new tag for testing. hello)r )r r s !N  8Ygo  %      ))'2G<  0 0#..A  = S\\!_h7 q 18< S\\!_i8 q 19= u~~6  enn= 3 ))1- ++R0 7rctdtdD}|jtdtj t jj|jy)z Cloning a tag containing a generator is unsafe. To avoid breaking programs that only flatten the clone or only flatten the original, we deprecate old behavior rather than making it an error immediately. c32K|]}t|ywN)str).0ns r z:TagTests.test_cloneGeneratorDeprecation..ys.qCF.s zCloning a Tag which contains a generator is unsafe, since the generator can be consumed only once; this is deprecated since Twisted 21.7.0 and will raise an exception in the futureN) rrange assertWarnsDeprecationWarningsysmodulesr __module____file__r=rs rtest_cloneGeneratorDeprecationz'TagTests.test_cloneGeneratorDeprecationssM .E"I..   ) KK ' 0 0 II rc"dtfd}|}td|d} |jtdtj t jj|j|jy#|jwxYw)z Cloning a tag containing a coroutine is unsafe. To avoid breaking programs that only flatten the clone or only flatten the original, we deprecate old behavior rather than making it an error immediately. r cKtwrJ)NotImplementedErrorrr asyncFuncz:TagTests.test_cloneCoroutineDeprecation..asyncFuncs % %s 123789zCloning a Tag which contains a coroutine is unsafe, since the coroutine can run only once; this is deprecated since Twisted 21.7.0 and will raise an exception in the futureN) rrrQrRrSrTr rUrVr=close)rr\corors rtest_cloneCoroutineDeprecationz'TagTests.test_cloneCoroutineDeprecationst & &{E4'    "- CNN+44   JJLDJJLs A A<<Bctdddd}|j|j|jg|j|jddiy)zk L{Tag.clear} removes all children from a tag, but leaves its attributes in place. z these arer?coolzthis-attribute)andSoIsrdN)rclearrr?rrs r test_clearzTagTests.test_clearsL KV=MN  r* )5E)FGrcvtd}|}|d|j|jddiy)z L{Tag.__call__} accepts Python keywords with a suffixed underscore as the DOM attribute of that literal suffix. divr )class_classN)r rr)rrrs r test_suffixzTagTests.test_suffixs3 E g 3 '38rcL|jttddy)zo L{Comment.__repr__} returns a value which makes it easy to see what's in the comment. z hello therezComment('hello there')N)rreprrrs rtest_commentReprPy3zTagTests.test_commentReprPy3s gm457OPrcL|jttddy)zm L{CDATA.__repr__} returns a value which makes it easy to see what's in the comment. z test datazCDATA('test data')N)rrmrrns rtest_cdataReprPy3zTagTests.test_cdataReprPy3s eK013GHrcbtd}|jtt|dy)zw L{CharRef.__repr__} returns a value which makes it easy to see what character is referred to. u☃z CharRef(9731)N)ordrrmr)rsnowmans rtest_charrefReprzTagTests.test_charrefReprs( m$ gg./Ar)r N)__name__rU __qualname____doc__rr%r*rBrGrWrarfrkrorqrur[rrrrsH-  >82 8D "2H9QIBrr)rxrStypingrtwisted.trial.unittestrtwisted.web.templaterrrrr rrr[rrr|sE  +JJ"k"""mBxmBr