Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.145.191.247
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_string.pyo
�
@��cc@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((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyt
checkequalscGsL|j|��}tt|�||�WdQX|j|jjdd�dS(Nit(tassertRaisesRRtassertNotEqualt	exceptionR(RtexctobjRRtcm((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pytcheckraisesscGstt|�||�dS(N(RR(RR
RR((s7/usr/local/python-2.7/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((((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pytf6st+sjoin() ate exception messagesexception not raised(RRRR(R(RRtSequenceRRthave_unicodetunicodeRt	TypeErrortBadSeq1tBadSeq2tfixtypeRtstrtfail(RtiR#te((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyt	test_joins6"	++++(	(t__name__t
__module__R,t	type2testRRRR0(((s7/usr/local/python-2.7/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((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyt
test_attrsBscCsI|jtjd�d�|jttjd�|jttjd�dS(Ns 1 is 1xs x1 (RRtatoiRt
ValueError(R((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyt	test_atoiMscCsI|jtjd�d�|jttjd�|jttjd�dS(Ns  1  ls  1x s  x1 (RRtatolRR@(R((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyt	test_atolRscCsI|jtjd�d�|jttjd�|jttjd�dS(Ns  1  g�?s  1x s  x1 (tassertAlmostEqualRtatofRR@(R((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyt	test_atofWscCs?d}|jtjdd�|�|jttjdd�dS(Ns	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`xyzdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������������������Rtxyztxyzq(RRt	maketransRR@(Rt
transtable((s7/usr/local/python-2.7/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((s7/usr/local/python-2.7/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((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyRUwscSsTt|t�r:y||SWqPtk
r6|j|SXntjj|||�dS(N(t
isinstanceR,tKeyErrorRVRRTt	get_value(RtkeyRtkwds((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyRY{s
(R1R2RURY(((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyRSvsthellotgreetings{greeting}, world!s
hello, world!t
CallFormattercBseZd�ZRS(cSst|�|�S(N(tformat(Rtvaluetformat_spec((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pytformat_field�s(R1R2Rb(((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyR^�ss*{0}*cSsdS(NR	((((s7/usr/local/python-2.7/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(s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyRh�s(R1R2Rh((Rd(s7/usr/local/python-2.7/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((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pytparse�s
(R1R2Rs(((s7/usr/local/python-2.7/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((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pytcheck_unused_args�s
(R1R2R~(((s7/usr/local/python-2.7/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((Rds7/usr/local/python-2.7/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�((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyttest_format_keyword_arguments�s(
R1R2R>RARCRFRKRMR�R�(((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyR4@s							ZtBytesAliasTestcBseZd�Zd�ZRS(cCs|jttk�dS(N(t
assertTrueR,tbytes(R((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyttest_builtin�scCsP|jdd�|jdd�|jtd�t�|jtd�t�dS(Ntspamsegg\fooR(RR�ttypeR,(R((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyttest_syntax�s(R1R2R�R�(((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyR��s	tBagcBseZRS((R1R2(((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyR��stMappingcBseZd�ZRS(cCsW|}xJ|jd�D]9}yt||�}Wqtk
rNt|��qXqW|S(NR!(RmRtAttributeErrorRX(RtnameRtpart((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyt__getitem__�s
(R1R2R�(((s7/usr/local/python-2.7/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((s7/usr/local/python-2.7/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((s7/usr/local/python-2.7/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�((s7/usr/local/python-2.7/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((s7/usr/local/python-2.7/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((s7/usr/local/python-2.7/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�tfredR�R�skung paos'('tim', 'fred') ate ('ham', 'kung pao')(R�R�(R�skung pao(RRR�R�R�(RR�R�R((s7/usr/local/python-2.7/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}R�R�s$who likes ham for dinnerstim likes ham for ${meal}stim likes ham for dinner(RRR�R�(RR�R�((s7/usr/local/python-2.7/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�((s7/usr/local/python-2.7/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(((s7/usr/local/python-2.7/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(	RR�R�tbagRNR�R�RR�(RR�tmR�((s7/usr/local/python-2.7/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(((s7/usr/local/python-2.7/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�(((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyR�Ms(RR�R�R�RNR�R�RR�RR@R�(RR�R�R�R�((s7/usr/local/python-2.7/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�(((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyR�ZssPyCon in $@@location@@t	ClevelandtlocationsPyCon in Cleveland(RRRXR�R(RR�ttmpltttval((s7/usr/local/python-2.7/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�(((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyR�kssPyCon in $@@location@@R�R�sPyCon in Cleveland(RRR�(RR�R�R�R�((s7/usr/local/python-2.7/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((s7/usr/local/python-2.7/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�((s7/usr/local/python-2.7/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((s7/usr/local/python-2.7/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(((s7/usr/local/python-2.7/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�(((s7/usr/local/python-2.7/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�((s7/usr/local/python-2.7/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�(((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyR��s 																	cCstjtttt�dS(N(Rtrun_unittestRR4R�R�(((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyt	test_main�st__main__(((tunittestRRRRRRRt
CommonTesttMixinStrStringUserStringTestRtTestCaseR4R�R�R�R�R�R1(((s7/usr/local/python-2.7/lib/python2.7/test/test_string.pyt<module>s7��	
© 2025 GrazzMean