%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/test/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/test/test_sgmllib.pyc

ó
Nêáac@sÊddlZddlZddlZddlmZejddeƒZdejfd„ƒYZ	de	fd„ƒYZ
d	e	fd
„ƒYZdejfd„ƒYZ
d
„ZedkrÆeƒndS(iÿÿÿÿN(ttest_supporttsgmllibt
deprecatedtEventCollectorcBskeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„ZRS(cCs,g|_|jj|_tjj|ƒdS(N(teventstappendRt
SGMLParsert__init__(tself((s-/usr/local/lib/python2.7/test/test_sgmllib.pyR
s	cCs‰g}d}xm|jD]b}|d}||ko=dknred|dd|df|d<n
|j|ƒ|}qW||_|S(Nitdataiÿÿÿÿi(tNoneRR(RtLtprevtypeteventttype((s-/usr/local/lib/python2.7/test/test_sgmllib.pyt
get_eventss
#

	cCs|jd||fƒdS(Ntstarttag(R(Rttagtattrs((s-/usr/local/lib/python2.7/test/test_sgmllib.pytunknown_starttag scCs|jd|fƒdS(Ntendtag(R(RR((s-/usr/local/lib/python2.7/test/test_sgmllib.pytunknown_endtag#scCs|jd|fƒdS(Ntcomment(R(RR	((s-/usr/local/lib/python2.7/test/test_sgmllib.pythandle_comment(scCs|jd|fƒdS(Ntcharref(R(RR	((s-/usr/local/lib/python2.7/test/test_sgmllib.pythandle_charref+scCs|jd|fƒdS(NR	(R(RR	((s-/usr/local/lib/python2.7/test/test_sgmllib.pythandle_data.scCs|jd|fƒdS(Ntdecl(R(RR((s-/usr/local/lib/python2.7/test/test_sgmllib.pythandle_decl1scCs|jd|fƒdS(Nt	entityref(R(RR	((s-/usr/local/lib/python2.7/test/test_sgmllib.pythandle_entityref4scCs|jd|fƒdS(Ntpi(R(RR	((s-/usr/local/lib/python2.7/test/test_sgmllib.pyt	handle_pi7scCs|jd|fƒdS(Nsunknown decl(R(RR((s-/usr/local/lib/python2.7/test/test_sgmllib.pytunknown_decl:s(
t__name__t
__module__RRRRRRRRRR R!(((s-/usr/local/lib/python2.7/test/test_sgmllib.pyRs										tCDATAEventCollectorcBseZd„ZRS(cCs$|jdd|fƒ|jƒdS(NRtcdata(Rt
setliteral(RR((s-/usr/local/lib/python2.7/test/test_sgmllib.pytstart_cdata?s(R"R#R'(((s-/usr/local/lib/python2.7/test/test_sgmllib.pyR$>stHTMLEntityCollectorcBsDeZejdƒZd„Zd„Zd„Zd„Zd„Z	RS(s:(?:&([a-zA-Z][-.a-zA-Z0-9]*)|&#(x[0-9a-zA-Z]+|[0-9]+))(;?)cCs:|jdd|fƒ|ddkr6tj||ƒSdS(NRtconvertitx(RRtconvert_charref(Rtname((s-/usr/local/lib/python2.7/test/test_sgmllib.pyR+IscCs*|jdd|fƒtj||ƒdS(Nt	codepointR)(RRtconvert_codepoint(RR-((s-/usr/local/lib/python2.7/test/test_sgmllib.pyR.NscCs&|jdd|fƒtj||ƒS(NRR)(RRtconvert_entityref(RR,((s-/usr/local/lib/python2.7/test/test_sgmllib.pyR/RscCs*|jd|fƒtjj||ƒdS(NR(RRRR(RR	((s-/usr/local/lib/python2.7/test/test_sgmllib.pyRZscCs*|jd|fƒtjj||ƒdS(NR(RRRR(RR	((s-/usr/local/lib/python2.7/test/test_sgmllib.pyR^s(
R"R#tretcompiletentity_or_charrefR+R.R/RR(((s-/usr/local/lib/python2.7/test/test_sgmllib.pyR(Ds				tSGMLParserTestCasecBseZeZd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d„Zd„Zd	„Z
d
„Zd„Zd„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!RS(cCsO|jƒ}y,x|D]}|j|ƒqW|jƒWn
‚nX|jƒS(N(t	collectortfeedtcloseR(Rtsourcetparserts((s-/usr/local/lib/python2.7/test/test_sgmllib.pyRgs
cCs^y|j|ƒ}Wn
‚nX||krZ|jdtj|ƒdtj|ƒƒndS(Ns8received events did not match expected events
Expected:
s
Received:
(Rtfailtpprinttpformat(RR7texpected_eventsR((s-/usr/local/lib/python2.7/test/test_sgmllib.pytcheck_eventsrscCsetƒ}y|j|ƒ|jƒWntjk
r:n'X|jd|tj|jƒƒfƒdS(Ns+expected SGMLParseError for %r
Received:
%s(	RR5R6RtSGMLParseErrorR:R;R<R(RR7R8((s-/usr/local/lib/python2.7/test/test_sgmllib.pytcheck_parse_error~s	
	cCs*d}|jd|gd|fgƒdS(NsòDOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01//EN'
             SYSTEM 'http://www.w3.org/TR/html401/strict.dtd' [
  <!ELEMENT html - O EMPTY>
  <!ATTLIST html
      version CDATA #IMPLIED
      profile CDATA 'DublinCore'>
  <!NOTATION datatype SYSTEM 'http://xml.python.org/notations/python-module'>
  <!ENTITY myEntity 'internal parsed entity'>
  <!ENTITY anEntity SYSTEM 'http://xml.python.org/entities/something.xml'>
  <!ENTITY % paramEntity 'name|name|name'>
  %paramEntity;
  <!-- comment -->
]s<!%s>R(R>(Rtinside((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_doctype_decl_internal‰scCs'd}|jd|d|fgƒdS(Ns/DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01//EN's<!%s>R(R>(RRA((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_doctype_decl_externalœs
cCs&|jdddddgfgƒdS(	s7Make sure attribute names with underscores are accepteds<a has_under _under>Rtat	has_undert_underN(RERE(RFRF(R>(R((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_underscore_in_attrname¢s		cCs#|jdddgfdgƒdS(s1Make sure tag names with underscores are accepteds<has_under></has_under>RRERN(RRE(R>(R((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_underscore_in_tagnameªs	cCs#|jddddgfgƒdS(s@Be sure quotes in unquoted attributes are made part of the values<a href=foo'bar"baz>RRDthrefsfoo'bar"bazN(RIsfoo'bar"baz(R>(R((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_quotes_in_unquoted_attrs²s	cCs2|jdddgfd	ddgfd
gƒdS(s(Handling of XHTML-style empty start tagss<br />text<i></i>RtbrR	ttexttiRN(R	RL(RRM(R>(R((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_xhtml_empty_tag¹s
	cCs|jddgƒdS(Ns<?processing instruction>Rsprocessing instruction(Rsprocessing instruction(R>(R((s-/usr/local/lib/python2.7/test/test_sgmllib.pyt test_processing_instruction_onlyÂs	cCs2|jdddgfddgfddgƒdS(Ns<a><b></a></b>RRDtbR(RRD(RRP(R>(R((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_bad_nestingÇs
	cCs|jddgƒdS(Ns#this text & contains & ampersands &R	(R	s#this text & contains & ampersands &(R>(R((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_bare_ampersandsÏs	cCs|jddgƒdS(Ns.this < text > contains < bare>pointy< bracketsR	(R	s.this < text > contains < bare>pointy< brackets(R>(R((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_bare_pointy_bracketsÔs	cCsbdddd
ddgfg}|jd|ƒ|jd	|ƒ|jd
|ƒ|jd|ƒdS(NRRDRPtvtctdtes<a b='v' c="v" d=v e>s<a  b = 'v' c = "v" d = v e>s<a
b
=
'v'
c
=
"v"
d
=
v
e>s<a	b	=	'v'	c	=	"v"	d	=	v	e>(RPRT(RURT(RVRT(RWRW(R>(Rtoutput((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_attr_syntaxÙs
cCs¸|jddddddgfgƒ|jd
ddddgfgƒd}d
}d}d|||f}|jd|ddd|fgfgƒ|jddddgfgƒdS(Ns'<a b='xxx
	xxx' c="yyy	
yyy" d='	xyz
'>RRDRPsxxx
	xxxRUsyyy	
yyyRVs	xyz
s
<a b='' c="">ts$-_.+s!*'(),s;/?:@&=s+http://example.com:8080/path/to/file?%s%s%ss<e a=%s>RWs<e a=rgb(1,2,3)>s
rgb(1,2,3)(RPsxxx
	xxx(RUsyyy	
yyy(RVs	xyz
(RPRZ(RURZ(RDs
rgb(1,2,3)(R>(Rtsafetextratreservedturl((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_attr_valuesâs			
	cCs>|jdddddddddddd d!g
fgƒdS("s9Substitution of entities and charrefs in attribute valuessÙ<a b=&lt; c=&lt;&gt; d=&lt-&gt; e='&lt; '
                                f="&xxx;" g='&#32;&#33;' h='&#500;'
                                i='x?a=b&c=d;'
                                j='&amp;#42;' k='&#38;#42;'>RRDRPt<RUs<>RVs&lt->RWs< tfs&xxx;tgs !ths&#500;RMs
x?a=b&c=d;tjs&#42;tkN(RPR`(RUs<>(RVs&lt->(RWs< (Ras&xxx;(Rbs !(Rcs&#500;(RMs
x?a=b&c=d;(Rds&#42;(Res&#42;(R>(R((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_attr_values_entitiesùs	cCsGt|_|jddddddgfdddddddg
ƒdS(Ns3<a title="&ldquo;test&#x201d;">foo</a>&foobar;&#42;RR)tldquoRtx201dRRDttitles&ldquo;test&#x201d;R	tfooRtfoobart42R-i*(RR)Rg(RR)Rh(Ris&ldquo;test&#x201d;(R	Rj(RRD(RRk(RR)Rk(RRl(RR)Rl(R-R)i*(R(R4R>(R((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_convert_overridess		cCs)|jddddd	d
gfgƒdS(Ns<a a.b='v' c:d=v e-f=v>RRDsa.bRTsc:dse-f(sa.bRT(sc:dRT(se-fRT(R>(R((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_attr_funky_names s	cCs2|jddddgfdddgfgƒdS(NsR<a href='http://[1080::8:800:200C:417A]/'><a href=http://[1080::8:800:200C:417A]/>RRDRIshttp://[1080::8:800:200C:417A]/(RIshttp://[1080::8:800:200C:417A]/(RIshttp://[1080::8:800:200C:417A]/(R>(R((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_attr_value_ip6_url%s	cCsK|jdddgfddgfgƒ|jddddgfgƒdS(Ns<a<a>RRDs</a<a>R(RRD(R>(R((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_weird_starttags-s		cCs|jdƒdS(Ns<!DOCTYPE foo $ >(R@(R((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_declaration_junk_chars7scCs,d}|j|dddd	gfgƒdS(
Ns<foobar   
   one="1"	two=2   >RRktonet1ttwot2(RrRs(RtRu(R>(RR9((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_get_starttag_text:s	cCsud}t|_|j|ddgfd
dddgfddddgƒd}|j|ddgfddgƒdS(Nsb<cdata> <!-- not a comment --> &not-an-entity-ref; </cdata><notcdata> <!-- comment --> </notcdata>RR%R	s, <!-- not a comment --> &not-an-entity-ref; Rtnotcdatat Rs	 comment s$<cdata> <not a='start tag'> </cdata>s <not a='start tag'> (R	s, <!-- not a comment --> &not-an-entity-ref; (RR%(R	Rx(Rs	 comment (R	Rx(RRw(R	s <not a='start tag'> (RR%(R$R4R>(RR9((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_cdata_content@s 		
	cCs#d}|j|ddd	gƒdS(
Ns(abc<!spacer type="block" height="25">defR	tabcsunknown declsspacer type="block" height="25"tdef(R	Rz(sunknown declsspacer type="block" height="25"(R	R{(R>(RR9((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_illegal_declarationsUs
	cCsd}|j|dgƒdS(Ns-<!DOCTYPE doc [<!ATTLIST doc attr (a | b) >]>Rs*DOCTYPE doc [<!ATTLIST doc attr (a | b) >](Rs*DOCTYPE doc [<!ATTLIST doc attr (a | b) >](R>(RR9((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_enumerated_attr_type]s	cCsdd}ttjdƒƒ}tjƒ}x6|j|ƒ}|j|ƒt|ƒ|kr*Pq*q*WdS(Nissgml_input.html(topenRtfindfileRRtreadR5tlen(RtCHUNKRatfpR	((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_read_chunkscs
cCs/d}|j|ddd
ddgfgƒdS(
Ns@<signs exclamation="&#33" copyright="&#169" quoteleft="&#8216;">Rtsignstexclamationt!t	copyrights&#169t	quotelefts&#8216;(R†R‡(Rˆs&#169(R‰s&#8216;(R>(RR9((s-/usr/local/lib/python2.7/test/test_sgmllib.pyttest_only_decode_asciips
	cCsB|jddddgfgƒ|jdddd	gfgƒdS(
Ns	<a b='<'>RRDRPR`s	<a b='>'>t>(RPR`(RPR‹(R>(R((s-/usr/local/lib/python2.7/test/test_sgmllib.pyt_test_starttag_end_boundary~scCs+ddd*gfg}|jdg|ƒ|jddg|ƒ|jdd	g|ƒ|jd
dg|ƒ|jdd
g|ƒ|jddg|ƒddd+gfg}|jdg|ƒ|jddg|ƒ|jddg|ƒ|jd
dg|ƒ|jdd
g|ƒ|jddg|ƒd,g}|jddg|ƒ|jddg|ƒ|jddg|ƒ|jddg|ƒ|jdd g|ƒ|jd!d"g|ƒ|jd#d$g|ƒ|jd%d&g|ƒ|jd'd(g|ƒ|jd)dg|ƒ|jddg|ƒdS(-NRRDRPR`s	<a b='<'>s<a sb='<'>s<a bs='<'>s<a b=s'<'>s<a b='<s'>s<a b='<'R‹s	<a b='>'>sb='>'>s='>'>s'>'>s<a b='>s<a b='>'RRzRZs
<!--abc-->s	!--abc-->s<!s--abc-->s<!-s-abc-->s<!--sabc-->s<!--asbc-->s<!--absc-->s<!--abcs-->s<!--abc-s->s	<!--abc--(RPR`(RPR‹(RRz(R>(RRX((s-/usr/local/lib/python2.7/test/test_sgmllib.pyt_test_buffer_artefacts‚s4	cCsÇ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jd	ƒ|jd
ƒ|jdƒ|jdƒ|jd
ƒ|jdƒ|jdƒdS(NR`s<>s</$>s</s</as<$s<$>s<!s<a $>s<as<a foo='bar's<a foo='bars
<a foo='>'s	<a foo='>s<a foo=>(R@(R((s-/usr/local/lib/python2.7/test/test_sgmllib.pyt_test_starttag_junk_chars s













("R"R#RR4RR>R@RBRCRGRHRJRNRORQRRRSRYR_RfRmRnRoRpRqRvRyR|R}R„RŠRŒRRŽ(((s-/usr/local/lib/python2.7/test/test_sgmllib.pyR3cs>																						
						
			cCstjtƒdS(N(Rtrun_unittestR3(((s-/usr/local/lib/python2.7/test/test_sgmllib.pyt	test_main²st__main__(R;R0tunittestttestRt
import_moduletTrueRRRR$R(tTestCaseR3RR"(((s-/usr/local/lib/python2.7/test/test_sgmllib.pyt<module>s6ÿP	

Zerion Mini Shell 1.0