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: 18.191.174.5
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_textwrap.pyc
�
@��cc@s�ddlZddlmZddlmZmZmZmZdejfd��YZ	de	fd��YZ
de	fd	��YZd
e	fd��YZdejfd
��YZ
d�Zedkr�e�ndS(i����N(ttest_support(tTextWrappertwraptfilltdedenttBaseTestCasecBs2eZdZd�Zd�Zd�Zd�ZRS(s5Parent class with utility methods for textwrap tests.cCs�t|t�r_g}x5tt|��D]!}|jd|||f�q(Wdj|�}n"t|t�r�dt|�}n|S(Ns  %d: %rs
s  %s
(t
isinstancetlisttrangetlentappendtjoint
basestringtrepr(tselfttextintresultti((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pytshowscCs3|j||d|j|�|j|�f�dS(Nsexpected:
%s
but got:
%s(tassertEqualR(RRtexpect((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pytcheckscKs&t|||�}|j||�dS(N(RR(RttexttwidthRtkwargsR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyt
check_wrap$scCs3|jj|�}|j||d||f�dS(Ns
expected %r
but got  %r(twrappert_splitR(RRRR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pytcheck_split(s(t__name__t
__module__t__doc__RRRR(((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyRs
			tWrapTestCasecBseZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zejr�d�Zd�Zd�Znd�Zd�Zd�Z RS(cCstdd�|_dS(NRi-(RR(R((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pytsetUp1sc	Cs^d}|j|dddddddg�|j|d	d
dg�|j|d|g�dS(
Ns=Hello there, how are you this fine day?  I'm glad to hear it!isHello there,show are yous	this fines	day?  I'msglad to hearsit!i*s'Hello there, how are you this fine day?sI'm glad to hear it!iP(R(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_simple4s

cCs0|jddg�|jddgdt�dS(Ntitdrop_whitespace(RtFalse(R((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_empty_stringEscCs<|jddgdd�|jddgdddt�dS(NR#itinitial_indents++R$(RR%(R((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyt%test_empty_string_with_initial_indentJscCsxd}dddddg}tddt�}|j|�}|j||�|j|�}|j|d	j|��dS(
Ns�This is a paragraph that already has
line breaks.  But some of its lines are much longer than the others,
so it needs to be wrapped.
Some lines are 	tabbed too.
What a mess!
s)This is a paragraph that already has lines'breaks.  But some of its lines are muchs)longer than the others, so it needs to bes-wrapped.  Some lines are  tabbed too.  What asmess!i-tfix_sentence_endingss
(RtTrueRRRR(RRRRR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_whitespaceOs		cCs_tddt�}d}dg}|j|j|�|�d}dg}|j|j|�|�d}|j|j|�|�d}d	g}|j|j|�|�d
|_ddd
g}|j|j|�|�d}dddg}|j|j|�|�d|_dg}|j|j|�|�d}dg}|j|j|�|�dS(Ni<R)s$A short line. Note the single space.s%A short line.  Note the single space.s Well, Doctor? What do you think?s!Well, Doctor?  What do you think?s Well, Doctor?
What do you think?s)I say, chaps! Anyone for "tennis?"
Hmmph!s+I say, chaps!  Anyone for "tennis?"  Hmmph!is
I say, chaps!sAnyone for "tennis?"sHmmph!s1And she said, "Go to hell!"
Can you believe that?sAnd she said, "Go toshell!"  Can yous
believe that?s2And she said, "Go to hell!"  Can you believe that?sFile stdio.h is nice.(RR*RRR(RRRR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_fix_sentence_endingsgs4								cCs9d}|j|dddg�|j|ddg�dS(NsThis is a
short paragraph.isThis is a shorts
paragraph.i(sThis is a short paragraph.(R(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_wrap_short�s
cCs<d}|j|ddg�|j|ddgdd�dS(NsThis is a short line.is(1) This is a short line.R's(1) (R(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_wrap_short_1line�scCsUd}|j|dddg�|j|dddg�|j|dddg�dS(	NsBthis-is-a-useful-feature-for-reformatting-posts-from-tim-peters'lyi(sthis-is-a-useful-feature-for-s%reformatting-posts-from-tim-peters'lyi)i*s*this-is-a-useful-feature-for-reformatting-sposts-from-tim-peters'ly(R(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_hyphenated�s

cCs�d}|j|ddddg�|j|dddg�d	}|j|d
ddg�|j|d
ddg�|j|dd	g�dS(NsRPython 1.0.0 was released on 1994-01-26.  Python 1.0.1 was
released on 1994-02-15.i#sPython 1.0.0 was released ons1994-01-26.  Python 1.0.1 wassreleased on 1994-02-15.i(s(Python 1.0.0 was released on 1994-01-26.s(Python 1.0.1 was released on 1994-02-15.sI do all my shopping at 7-11.isI do all my shopping ats7-11.ii(R(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_hyphenated_numbers�s



cCs�d}|j|dddg�|j|dddg�dd	g}|j|d
|�|j|d|�|j|ddg�d
}dddg}|j|d|�|j|d|�dddg}|j|d|�|j|d|�ddg}|j|d|�|j|d|�ddg}|j|d|�|j|d|�d}ddddd dd!d"dd#d d$dd%d&d#dd'g}|j||�d(}d#dd)d d*d d+dd,dd-g}|j||�dS(.Ns$Em-dashes should be written -- thus.isEm-dashes should beswritten -- thus.isEm-dashes should be writtens-- thus.sEm-dashes should be written --sthus.ii#i$s%You can also do--this or even---this.sYou can also dos--this or evens---this.iisYou can also do--sthis or even---sthis.iisYou can also do--this or evenis You can also do--this or even---i s7Here's an -- em-dash and--here's another---and another!sHere'st tans--sem-tdashtandshere'stanothers---sanother!sand then--bam!--he was gonetthensbam!thetwastgone(RR(RRR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_em_dash�sR

	
				cCs4d}|j|dddddg�|j|ddd	d
g�ddg}|j|d
|�|j|d|�|j|d|�|j|d|�ddg}|j|d|�|j|d|�dd
g}|j|d|�d}ddddddddddddddg}|j||�dS( Ns<You should use the -n option, or --dry-run in its long form.isYou should use thes-n option, or --dry-srun in its longsform.isYou should use the -nsoption, or --dry-runsin its long form.s You should use the -n option, ors--dry-run in its long form.i i"i#i&s'You should use the -n option, or --dry-srun in its long form.i'i)s*You should use the -n option, or --dry-runi*s'the -n option, or --dry-run or --dryrunttheR1s-nsoption,tors--dry-truns--dryrun(RR(RRR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_unix_options�s6

			cCs�|jddddddg�|jddddg�|jd	ddd
g�|jddg�|jddg�|jd
ddg�|jdddddddg�dS(Nswhat the--hey!twhatR1R;s--shey!s
what the--sthe--swhat the--.sthe--.s	--text--.s--options--option-opts	--option-toptsfoo --option-opt bartfootbar(R(R((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_funky_hyphens s	cCs�|jdddddddg�|jddddd	ddg�|jd
ddddddg�|jd
ddddddg�dS(Nsthe 'wibble-wobble' widgetR;R1s'wibble-swobble'twidgetsthe "wibble-wobble" widgets"wibble-swobble"sthe (wibble-wobble) widgets(wibble-swobble)sthe ['wibble-wobble'] widgets	['wibble-swobble'](R(R((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_punct_hyphens1s				c	Csg|jddddddg�|jddddddg�|jd	d
dddddd
g�dS(Nsfoo (--option) barRAR1s
(--option)RBs
foo (bar) bazs(bar)tbazsblah (ding dong), wubbatblahs(dingsdong),twubba(R(R((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_funky_parensBs			c	Cs5d}|j|dddddddgd	t�dS(
Ns0 This is a    sentence with     much whitespace.i
s
 This is as    s	sentence s	with     s
much whitesspace.R$(RR%(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_drop_whitespace_falseOs
	cCs |jdddgdt�dS(Ns   iR$(RR%(R((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyt*test_drop_whitespace_false_whitespace_onlyXscCs&|jdddgdtdd�dS(Ns   is     R$R's  (RR%(R((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyt6test_drop_whitespace_false_whitespace_only_with_indent\scCs|jddg�dS(Ns  i(R(R((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyt$test_drop_whitespace_whitespace_onlybscCs9d}|j|ddg�|j|dddg�dS(Ns, This is a sentence with leading whitespace.i2is This is a sentence withsleading whitespace.(R(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyt'test_drop_whitespace_leading_whitespacefs

cCsEd}|j|ddddgdt�|j|dddg�dS(Nsabcd    efghitabcds    tefghR$(RR%(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyt$test_drop_whitespace_whitespace_lineqscCs|jddgdd�dS(Ns  iR's++(R(R((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyt0test_drop_whitespace_whitespace_only_with_indentzscCs)|jddddgdddd�dS(Ns	abcd efghis  abcds  efghR's  tsubsequent_indent(R(R((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyt&test_drop_whitespace_whitespace_indent�scCs�d}|j|ddg�|j|dddg�|jj|�}|j|t�|j|dt�|jj|�}|j|t�dS(NuHello there, how are you today?i2iuHello there, how ares
you today?i(RRRtassertIsInstanceRtunicodeR(RRtolinestotext((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_unicode�scCs&d}|j|ddddg�dS(NuDie Empfänger-Auswahli
uDieuEmpfänger-uAuswahl(R(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_no_split_at_umlaut�scCs#d}|j|dddg�dS(Nuaa ää-ääiuaa ää-uää(R(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_umlaut_followed_by_dash�scCsbd}|jj|�}|j|dddddddddddd	dd
ddddg�dS(
Ns0Hello there -- you goof-ball, use the -b option!tHelloR1ttheres--tyousgoof-sball,tuseR;s-bsoption!(RRR(RRR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyt
test_split�s
	cCsHd}|j|dddgdt�|j|dddgdt�dS(Ns
yaba daba-dooi
s
yaba daba-tdootbreak_on_hyphenstyabasdaba-doo(RR*R%(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_break_on_hyphens�s
cCs6d}|jtt|d�|jtt|d�dS(NsWhatever, it doesn't matter.ii����(tassertRaisest
ValueErrorR(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_bad_width�s(!RRR!R"R&R(R+R,R-R.R/R0R:R>RCRERIRJRKRLRMRNRQRRRTRthave_unicodeRYRZR[R`RdRg(((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyR /s<						*	
	
			7	"			
												
			tLongWordTestCasecBs#eZd�Zd�Zd�ZRS(cCst�|_d|_dS(Ns]Did you say "supercalifragilisticexpialidocious?"
How *do* you spell that odd word, anyways?
(RRR(R((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyR!�scCs�|j|jdddddg�|j|jdddg�|jdd
dd
ddddgdd�|j|jddddddddddg	�dS( NisDid you say "supercalifragilissticexpialidocious?" How *do*syou spell that odd word,sanyways?i2s1Did you say "supercalifragilisticexpialidocious?"s*How *do* you spell that odd word, anyways?t-i
thellos
----------s               hs               es               ls               oRSR1iisDid you say s"supercalifrtagilisticexpsialidocious?s
" How *do*s	you spellsthat oddsword,s
----------s----------hellos               (RR(R((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_break_long�s4

	cCs~d|j_d|j_ddddg}|jj|j�}|j||�t|jdddd�}|j||�dS(	NiisDid you says%"supercalifragilisticexpialidocious?"sHow *do* you spell that oddsword, anyways?Rtbreak_long_words(RRnRRRR(RRR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_nobreak_long�s	(RRR!RmRo(((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyRi�s		$tIndentTestCasescBs,eZd�Zd�Zd�Zd�ZRS(cCs
d|_dS(NsnThis paragraph will be filled, first without any indentation,
and then with some (including a hanging indent).(R(R((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyR!�scCs,d}t|jd�}|j||�dS(NsnThis paragraph will be filled, first
without any indentation, and then with
some (including a hanging indent).i((RRR(RRR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyt	test_fill�scCsrdddg}t|jddd�}|j||�dj|�}t|jddd�}|j||�dS(Ns#     This paragraph will be filled,s'first without any indentation, and thens'with some (including a hanging indent).i(R's     s
(RRRRR(RRR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_initial_indent	s	cCs8d}t|jddddd�}|j||�dS(Ns~  * This paragraph will be filled, first
    without any indentation, and then
    with some (including a hanging
    indent).i(R's  * RSs    (RRR(RRR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_subsequent_indents(RRR!RqRrRs(((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyRp�s			tDedentTestCasecBs>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(cCs|j|t|��dS(s,assert that dedent() has no effect on 'text'N(RR(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pytassertUnchanged)scCsPd}|j|�d}|j|�d}|j|�d}|j|�dS(Ns,Hello there.
How are you?
Oh good, I'm glad.sHello there.

Boo!s Hello there.
  This is indented.sHello there.

  Boo!
(Ru(RR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_dedent_nomargin-s


cCsjd}d}|j|t|��d}d}|j|t|��d}d}|j|t|��dS(Ns'  Hello there.
  How are ya?
  Oh good.s!Hello there.
How are ya?
Oh good.s)  Hello there.

  How are ya?
  Oh good.
s#Hello there.

How are ya?
Oh good.
s+  Hello there.
  
  How are ya?
  Oh good.
(RR(RRR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_dedent_even>scCsjd}d}|j|t|��d}d}|j|t|��d}d}|j|t|��dS(NsK        def foo():
            while 1:
                return foo
        s+def foo():
    while 1:
        return foo
s  Foo
    Bar

   Baz
sFoo
  Bar

 Baz
s  Foo
    Bar
 
   Baz
(RR(RRR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyttest_dedent_unevenNscCs<d}d}|j|t|��|j|t|��dS(Ns  hello	there
  how are	you?shello	there
how are	you?(RR(RRR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyt"test_dedent_preserve_internal_tabsgscCs�d}|j|�d}|j|�d}d}|j|t|��d}|j|t|��d}|j|t|��d}d}|j|t|��d	}d
}|j|t|��dS(Ns  hello there
	how are you?s!        hello there
	how are you?s	hello there
	how are you?shello there
how are you?s  	hello there
  	how are you?s"  	  hello there
  	  how are you?s   	hello there
  	  how are you?shello there
  how are you?s2  	hello there
   	how are you?
 	I'm fine, thankss/ 	hello there
  	how are you?
	I'm fine, thanks(RuRR(RRR((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyt test_dedent_preserve_margin_tabsss"

(RRRuRvRwRxRyRz(((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyRt's					cCstjtttt�dS(N(Rtrun_unittestR RiRpRt(((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyt	test_main�s	t__main__(tunittestttestRttextwrapRRRRtTestCaseRR RiRpRtR|R(((s9/usr/local/python-2.7/lib/python2.7/test/test_textwrap.pyt<module>s"��=3i	
© 2025 GrazzMean