%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_string.pyo

ó
Nêáac@sddlZddlZddlmZddlmZmZddlmZdejejfd„ƒYZ	dej
fd„ƒYZd	ej
fd
„ƒYZddd„ƒYZ
d
dd„ƒYZdej
fd„ƒYZd„ZedkrýeƒndS(iÿÿÿÿN(tTemplate(ttest_supporttstring_tests(tUserListt
StringTestcBs2eZeZd„Zd„Zd„Zd„ZRS(cGs,tt|ƒ||Œ}|j||ƒdS(N(tgetattrtstringtassertEqual(tselftresulttobjectt
methodnametargst
realresult((s,/usr/local/lib/python2.7/test/test_string.pyt
checkequalscGsL|j|ƒ}tt|ƒ||ŒWdQX|j|jjddƒdS(Nit(tassertRaisesRRtassertNotEqualt	exceptionR(RtexctobjRRtcm((s,/usr/local/lib/python2.7/test/test_string.pytcheckraisesscGstt|ƒ||ŒdS(N(RR(RR
RR((s,/usr/local/lib/python2.7/test/test_string.pyt	checkcallscCs‰|jdddddgddƒ|jdddd	ƒ|jd
tjƒddƒ|jddddƒ|jdtdgƒddƒtjrf|jtd
ƒdddgdtdƒƒ|jtd
ƒtdƒddgddƒ|jtd
ƒdtdƒdgddƒ|jtd
ƒddtdƒgddƒ|jtdtdƒdgddƒnxydddgD]h}|jd|d|d d|g|ddƒ|jd|d|d d|f|ddƒqvW|jttj	ƒddƒ|jdtj
ƒddƒy&d„}|jdƒj|ƒƒWn5tk
rw}dt
|ƒkr…|jdƒq…nX|jdƒdS(Nsa b c dtatbtctdtjoint tabcdRsw x y ztabctzsa.b.ct.iiii}t-iÿÿÿÿsa b ccss
ddVdS(NiR((((s,/usr/local/lib/python2.7/test/test_string.pytf6st+sjoin() ate exception messagesexception not raised(RRRR(R(RRtSequenceRRthave_unicodetunicodeRt	TypeErrortBadSeq1tBadSeq2tfixtypeRtstrtfail(RtiR#te((s,/usr/local/lib/python2.7/test/test_string.pyt	test_joins6"	++++(	(t__name__t
__module__R,t	type2testRRRR0(((s,/usr/local/lib/python2.7/test/test_string.pyRs
			t
ModuleTestcBsPeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	RS(cCsCtjtjtjtjtjtjtjtjtj	dS(N(
Rt
whitespacet	lowercaset	uppercasetletterstdigitst	hexdigitst	octdigitstpunctuationt	printable(R((s,/usr/local/lib/python2.7/test/test_string.pyt
test_attrsBscCsI|jtjdƒdƒ|jttjdƒ|jttjdƒdS(Ns 1 is 1xs x1 (RRtatoiRt
ValueError(R((s,/usr/local/lib/python2.7/test/test_string.pyt	test_atoiMscCsI|jtjdƒdƒ|jttjdƒ|jttjdƒdS(Ns  1  ls  1x s  x1 (RRtatolRR@(R((s,/usr/local/lib/python2.7/test/test_string.pyt	test_atolRscCsI|jtjdƒdƒ|jttjdƒ|jttjdƒdS(Ns  1  gð?s  1x s  x1 (tassertAlmostEqualRtatofRR@(R((s,/usr/local/lib/python2.7/test/test_string.pyt	test_atofWscCs?d}|jtjddƒ|ƒ|jttjddƒdS(Ns	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`xyzdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿRtxyztxyzq(RRt	maketransRR@(Rt
transtable((s,/usr/local/lib/python2.7/test/test_string.pyttest_maketrans\scCsë|jtjdƒdƒ|jtjdƒdƒ|jtjdƒdƒ|jtjdƒdƒ|jtjddƒdƒ|jtjd	ƒd
ƒ|jtjdƒdƒ|jtjd
ƒdƒ|jtjd
dƒdƒdS(Nsabc def ghisAbc Def Ghisabc	def
ghisabc	   def  
ghisABC DEF GHIsABC-DEF-GHIR"sAbc-Def-GhisABC-def DEF-ghi GHIsAbc-def Def-ghi Ghis   aBc  DeF   sAbc Defs		aBc	DeF	s	s		Abc	Def	(RRtcapwords(R((s,/usr/local/lib/python2.7/test/test_string.pyt
test_capwordsbsc
sÇtjƒ}|j|jdƒdƒ|j|jddƒdƒ|j|jdddƒdƒ|j|jdd	d
ƒdƒdtjfd
„ƒY}|idd6ƒ}|j|jdƒdƒdtjfd„ƒY}|ƒ}|j|jdd„ƒdƒdtjf‡fd†ƒY‰ˆƒ}|j|jdddƒdƒdtjfd„ƒY}|ƒ}|j|jddƒdƒdtjfd „ƒY}|ƒ}|j|jd!d"ƒd#ƒ|j|jd$d"d%d&ƒd'ƒ|j|jd(d"d)d%d&ƒd*ƒ|jt|jd(d"d)d%d&d+d,ƒ|jt|jd!d"d)ƒ|jt|jd!d"d)d%d&ƒ|jt|jd-d"d)d%d&ƒ|jttd.d/ƒ|jttd.d0ƒdS(1Ntfoosfoo{0}tbartfoobars
foo{1}{0}-{1}is	foo6bar-6s	-{arg!r}-targttests-'test'-tNamespaceFormattercBseZid„Zd„ZRS(cSstjj|ƒ||_dS(N(Rt	Formattert__init__t	namespace(RRV((s,/usr/local/lib/python2.7/test/test_string.pyRUwscSsTt|tƒr:y||SWqPtk
r6|j|SXntjj|||ƒdS(N(t
isinstanceR,tKeyErrorRVRRTt	get_value(RtkeyRtkwds((s,/usr/local/lib/python2.7/test/test_string.pyRY{s
(R1R2RURY(((s,/usr/local/lib/python2.7/test/test_string.pyRSvsthellotgreetings{greeting}, world!s
hello, world!t
CallFormattercBseZd„ZRS(cSst|ƒ|ƒS(N(tformat(Rtvaluetformat_spec((s,/usr/local/lib/python2.7/test/test_string.pytformat_field‹s(R1R2Rb(((s,/usr/local/lib/python2.7/test/test_string.pyR^Šss*{0}*cSsdS(NR	((((s,/usr/local/lib/python2.7/test/test_string.pyt<lambda>Rs*result*t
XFormattercseZ‡fd†ZRS(cs)|dkrdStˆ|ƒj||ƒS(Ntx(tNonetsupert
convert_field(RR`t
conversion(Rd(s,/usr/local/lib/python2.7/test/test_string.pyRh”s(R1R2Rh((Rd(s,/usr/local/lib/python2.7/test/test_string.pyRd“ss{0!r}:{0!x}s
'foo':NonetBarFormattercBseZd„ZRS(cssoxh|jdƒD]W}|ddkrV|djdƒ\}}}d||dfVq|dddfVqWdS(Nt|iR$it:R(tsplitt	partitionRf(Rt
format_stringtfieldt
field_namet_Ra((s,/usr/local/lib/python2.7/test/test_string.pytparse¡s
(R1R2Rs(((s,/usr/local/lib/python2.7/test/test_string.pyRjžss*|+0:^10s|*s*   foo    *tCheckAllUsedFormattercBseZd„ZRS(cSset|jƒƒ}|jtdt|ƒƒƒx|D]}|j|ƒq5W|ratdƒ‚ndS(Nisunused arguments(tsettkeystupdatetrangetlentremoveR@(Rt	used_argsRtkwargstunused_argsRQ((s,/usr/local/lib/python2.7/test/test_string.pytcheck_unused_args¯s
(R1R2R~(((s,/usr/local/lib/python2.7/test/test_string.pyRt®ss{0}i
t10s{0}{i}R.idt10100s	{0}{i}{1}it1010020tjis{i}Rt#s#20(RRTRR_RR@(RtfmtRSR^RjRt((Rds,/usr/local/lib/python2.7/test/test_string.pyttest_formatterms8				"%(""cCsÑtjƒ}|j|jdddƒdƒ|jt|jdƒ|j|jdddƒdƒ|jt|jdƒ|j|jdddƒdƒ|jt|jdƒ|j|jddddƒdƒdS(	Ns-{arg}-RQRRs-test-s-{self}-Rs-{format_string}-Ro(RRTRR_RRX(RR„((s,/usr/local/lib/python2.7/test/test_string.pyttest_format_keyword_argumentsÇs(
R1R2R>RARCRFRKRMR…R†(((s,/usr/local/lib/python2.7/test/test_string.pyR4@s							ZtBytesAliasTestcBseZd„Zd„ZRS(cCs|jttkƒdS(N(t
assertTrueR,tbytes(R((s,/usr/local/lib/python2.7/test/test_string.pyttest_builtinÕscCsP|jddƒ|jddƒ|jtdƒtƒ|jtdƒtƒdS(Ntspamsegg\fooR(RRˆttypeR,(R((s,/usr/local/lib/python2.7/test/test_string.pyttest_syntaxØs(R1R2RŠR(((s,/usr/local/lib/python2.7/test/test_string.pyR‡Ós	tBagcBseZRS((R1R2(((s,/usr/local/lib/python2.7/test/test_string.pyRŽástMappingcBseZd„ZRS(cCsW|}xJ|jdƒD]9}yt||ƒ}Wqtk
rNt|ƒ‚qXqW|S(NR!(RmRtAttributeErrorRX(RtnameRtpart((s,/usr/local/lib/python2.7/test/test_string.pyt__getitem__ås
(R1R2R“(((s,/usr/local/lib/python2.7/test/test_string.pyRästTestTemplatecBs˜eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
d„Zd
„Zd„Zd„ZRS(cCsjtdƒ}|j|jtddddƒƒdƒ|jt|jtddƒƒ|jttjƒdS(Ns,$who likes to eat a bag of $what worth $$100twhottimtwhatthams(tim likes to eat a bag of ham worth $100(RRt
substitutetdictRRXR((Rts((s,/usr/local/lib/python2.7/test/test_string.pyttest_regular_templatesðs
!cCsitdƒ}tddddddƒ}|j|j|ƒdƒ|jt|jtddddƒƒdS(	Ns$who likes ${what} for ${meal}R•R–R—R˜tmealtdinnerstim likes ham for dinner(RRšRR™RRX(RR›R((s,/usr/local/lib/python2.7/test/test_string.pyt"test_regular_templates_with_braces÷s
cCso|j}tdƒ}||jtddddƒƒdƒtdƒ}||jtddddƒƒdƒdS(	Ns-$who likes to eat a bag of $$what worth $$100R•R–R—R˜s*tim likes to eat a bag of $what worth $100s
$who likes $$stim likes $(RRR™Rš(RteqR›((s,/usr/local/lib/python2.7/test/test_string.pyttest_escapesþs	cCsT|j}tdƒ}tddƒ}||j|ƒdƒ||j|ƒdƒdS(Ns%(foo)s $foo ${foo}RNtbazs%(foo)s baz baz(RRRšR™tsafe_substitute(RR R›R((s,/usr/local/lib/python2.7/test/test_string.pyt
test_percentss
	cCsv|j}tdƒ}tddƒ}||j|ƒdƒ||j|ƒdƒtdƒ}||j|ƒdƒdS(Ns&tim has eaten $count bags of ham todaytcountis!tim has eaten 7 bags of ham todays(tim has eaten ${count} bags of ham today(RRRšR™R£(RR R›R((s,/usr/local/lib/python2.7/test/test_string.pyttest_stringification
s	cCsZ|j}tdƒ}tdd	dd
ƒ}||j|ƒdƒ||j|ƒdƒdS(Ns$who ate ${meal}R•R–tfredRR˜skung paos'('tim', 'fred') ate ('ham', 'kung pao')(R–R§(R˜skung pao(RRRšR™R£(RR R›R((s,/usr/local/lib/python2.7/test/test_string.pyttest_tupleargss
	c	CsÌ|j}tdƒ}||jtddƒƒdƒ||jtddƒƒdƒ||jtdddd	ƒƒd
ƒ||jtddddƒƒdƒ||jtdddddd	ƒƒdƒdS(
Ns$who likes ${what} for ${meal}R•R–stim likes ${what} for ${meal}R—R˜s$who likes ham for ${meal}RRžs$who likes ham for dinnerstim likes ham for ${meal}stim likes ham for dinner(RRR£Rš(RR R›((s,/usr/local/lib/python2.7/test/test_string.pyttest_SafeTemplates	$cCs…|j}tdƒ}|t|jtddƒƒtdƒ}|t|jtddƒƒtdƒ}|t|jtddƒƒdS(Ns$who likes $R•R–s$who likes ${what)s$who likes $100(RRR@R™Rš(RtraisesR›((s,/usr/local/lib/python2.7/test/test_string.pyttest_invalid_placeholders)s	cCs~dtfd„ƒY}tƒ}tƒ|_tƒ|j_d|jj_d|j_|dƒ}|j|j|ƒdƒdS(NtPathPatterncBseZdZRS(s[_a-z][._a-z0-9]*(R1R2t	idpattern(((s,/usr/local/lib/python2.7/test/test_string.pyR¬3sR–R˜s,$bag.foo.who likes to eat a bag of $bag.whatstim likes to eat a bag of ham(	RRRŽtbagRNR•R—RR™(RR¬tmR›((s,/usr/local/lib/python2.7/test/test_string.pyttest_idpattern_override2s	cCsÌdtfd„ƒY}tƒ}tƒ|_tƒ|j_d|jj_d|j_|dƒ}|j|j|ƒdƒdtfd„ƒY}|dƒ}|j	t
|jiƒ|j	t
|jiƒdS(	Nt	MyPatterncBseZdZRS(s¾
            (?P<escaped>@{2})                   |
            @(?P<named>[_a-z][._a-z0-9]*)       |
            @{(?P<braced>[_a-z][._a-z0-9]*)}    |
            (?P<invalid>@)
            (R1R2tpattern(((s,/usr/local/lib/python2.7/test/test_string.pyR±>sR–R˜s,@bag.foo.who likes to eat a bag of @bag.whatstim likes to eat a bag of hamt
BadPatterncBseZdZRS(s
            (?P<badname>.*)                     |
            (?P<escaped>@{2})                   |
            @(?P<named>[_a-z][._a-z0-9]*)       |
            @{(?P<braced>[_a-z][._a-z0-9]*)}    |
            (?P<invalid>@)                      |
            (R1R2R²(((s,/usr/local/lib/python2.7/test/test_string.pyR³Ms(RRRŽR®RNR•R—RR™RR@R£(RR±R¯R›R³((s,/usr/local/lib/python2.7/test/test_string.pyttest_pattern_override=s	cCshdtfd„ƒY}d}||ƒ}|jt|jiƒ|jidd6ƒ}|j|dƒdS(Nt
MyTemplatecBseZdZRS(s÷
            \$(?:
              (?P<escaped>$)                     |
              (?P<named>[_a-z][_a-z0-9]*)        |
              @@(?P<braced>[_a-z][_a-z0-9]*)@@   |
              (?P<invalid>)                      |
           )
           (R1R2R²(((s,/usr/local/lib/python2.7/test/test_string.pyRµZssPyCon in $@@location@@t	ClevelandtlocationsPyCon in Cleveland(RRRXR™R(RRµttmpltttval((s,/usr/local/lib/python2.7/test/test_string.pyttest_braced_overrideYs
cCshdtfd„ƒY}d}||ƒ}|j|jƒ|ƒ|jidd6ƒ}|j|dƒdS(NRµcBseZdZRS(s÷
            \$(?:
              (?P<escaped>$)                     |
              (?P<named>[_a-z][_a-z0-9]*)        |
              @@(?P<braced>[_a-z][_a-z0-9]*)@@   |
              (?P<invalid>)                      |
           )
           (R1R2R²(((s,/usr/local/lib/python2.7/test/test_string.pyRµkssPyCon in $@@location@@R¶R·sPyCon in Cleveland(RRR£(RRµR¸R¹Rº((s,/usr/local/lib/python2.7/test/test_string.pyttest_braced_override_safejs
cCs>tdƒ}tddddƒ}|j|j|ƒdƒdS(Ns$who likes $whatR•utÿmR—ufþedutÿm likes fþed(RRšRR™(RR›R((s,/usr/local/lib/python2.7/test/test_string.pyttest_unicode_values{scCs	|j}tdƒ}||jddddƒdƒ||jtddƒddƒdƒ||jtddddƒddddƒdƒtd	ƒ}||jtd
dƒdd
ƒdƒ||jtddƒddƒdƒtdƒ}||jdd
ƒdƒdS(Ns$who likes $whatR•R–R—R˜s
tim likes hamR§skung paosthe mapping is $mappingRNtnonetmappingtbozosthe mapping is bozotonettwosthe mapping is twosthe self is $selfRsthe self is bozo(RRR™Rš(RR R›((s,/usr/local/lib/python2.7/test/test_string.pyttest_keyword_arguments€s	%cCsM|j}|j}tdƒ}||jddddƒdƒ||jtddƒddƒdƒ||jtddddƒddddƒdƒtd	ƒ}||jtd
dƒdd
ƒdƒ||jtddƒddƒdƒtddƒ}|t|j|iƒ|t|j|iƒtdƒ}||jdd
ƒdƒdS(Ns$who likes $whatR•R–R—R˜s
tim likes hamR§skung paosthe mapping is $mappingRNR¾R¿RÀsthe mapping is bozoRÁRÂsthe mapping is twosthe self is $selfRsthe self is bozo(RRRR£RšR(R™(RR RªR›R((s,/usr/local/lib/python2.7/test/test_string.pyttest_keyword_arguments_safe‘s$		%cCs$|j}|j}dtfd„ƒY}|dƒ}||jddddƒdƒ|t|jƒ||jddddƒdƒ||jƒd	ƒ|d	ƒ}|t|jtddddƒƒ||jƒd	ƒd
tfd„ƒY}|dƒ}|j|jtdd
ddƒƒdƒdS(NtAmpersandTemplatecBseZdZRS(t&(R1R2t	delimiter(((s,/usr/local/lib/python2.7/test/test_string.pyRÅ©ssthis &gift is for &{who} &&tgifttbudR•tyousthis bud is for you &sthis &gift is for &{who} &t	PieDelimscBseZdZRS(t@(R1R2RÇ(((s,/usr/local/lib/python2.7/test/test_string.pyRË´ss-@who likes to eat a bag of @{what} worth $100R–R—R˜s(tim likes to eat a bag of ham worth $100(RRRR™RXR£R@Rš(RR RªRÅR›RË((s,/usr/local/lib/python2.7/test/test_string.pyttest_delimiter_override¦s		"!(R1R2RœRŸR¡R¤R¦R¨R©R«R°R´R»R¼R½RÃRÄRÍ(((s,/usr/local/lib/python2.7/test/test_string.pyR”ïs 																	cCstjttttƒdS(N(Rtrun_unittestRR4R‡R”(((s,/usr/local/lib/python2.7/test/test_string.pyt	test_main»st__main__(((tunittestRRRRRRRt
CommonTesttMixinStrStringUserStringTestRtTestCaseR4R‡RŽRR”RÏR1(((s,/usr/local/lib/python2.7/test/test_string.pyt<module>s7“Ì	

Zerion Mini Shell 1.0