ó {G_Tc@s2ddlZddlZdefd„ƒYZdS(iÿÿÿÿNtMixinBytesBufferCommonTestscBs¹eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zd„Zd„Zd„ZRS(sITests that work for both bytes and buffer objects. See PEP 3137. cCstdƒ‚dS(s4Convert x into the appropriate type for these tests.s(test class must provide a marshal methodN(t RuntimeError(tselftx((s-/usr/local/lib/python2.7/test/buffer_tests.pytmarshal scCsç|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|jt|jdƒjdƒdS( NttatAs tabctaBcsabc i*(t assertFalseRtislowert assertTruet assertRaisest TypeError(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyt test_islowerscCsç|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|jt|jdƒjd ƒdS( NRRRs tABCtAbCsABC Ri*(R RtisupperR R R(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyt test_isupperscCsW|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jd ƒjƒƒ|j|jd ƒjƒƒ|j|jd ƒjƒƒ|jt|jd ƒjd ƒdS(NRRRs sA Titlecased LinesA Titlecased LinesA Titlecased, LinesNot a capitalized StringsNot a Titlecase StringsNot--a Titlecase StringtNOTRi*(R RtistitleR R R(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyt test_istitle$scCs|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|jt|jd ƒjd ƒdS( NRRt s s s s s aRi*(R RtisspaceR R R(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyt test_isspace2scCsç|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|jt|jdƒjdƒdS( NRRRs RtaBc123sabc i*(R RtisalphaR R R(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyt test_isalpha=scCs|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|jt|jd ƒjd ƒdS( NRRRs t 123abc456ta1b3csaBc000 sabc Ri*(R RtisalnumR R R(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyt test_isalnumGscCs¯|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|j|jdƒjƒƒ|jt|jdƒjdƒdS(NRRt0t 0123456789t 0123456789aRi*(R RtisdigitR R R(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyt test_isdigitRs cCsa|jd|jdƒjƒƒ|jd|jdƒjƒƒ|jt|jdƒjdƒdS(NthellotHeLLoi*(t assertEqualRtlowerR R(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyt test_lower[scCsa|jd|jdƒjƒƒ|jd|jdƒjƒƒ|jt|jdƒjdƒdS(NtHELLOR'R&i*(R(RtupperR R(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyt test_upper`scCs¾|jd|jdƒjƒƒ|jd|jdƒjƒƒ|jd|jdƒjƒƒ|jd|jdƒjƒƒ|jd|jdƒjƒƒ|jt|jdƒjdƒdS( Ns hello sHello shello tAaaataaaatAaAaR&i*(R(Rt capitalizeR R(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyttest_capitalizees cCsÍ|jd|jdƒjdƒƒ|jd|jdƒjdƒƒ|jd|jdƒjdƒƒ|jd|jdƒjdƒƒ|jd|jdƒjdd ƒƒ|jt|jdƒjƒdS( Ns abc Ri sabc iiis abc*******t*(R(RtljustR R(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyt test_ljustns """"%cCsÍ|jd|jdƒjdƒƒ|jd|jdƒjdƒƒ|jd|jdƒjdƒƒ|jd|jdƒjdƒƒ|jd|jdƒjdd ƒƒ|jt|jdƒjƒdS( Ns abcRi s abciiis *******abcR3(R(RtrjustR R(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyt test_rjustvs """"%cCsÍ|jd|jdƒjdƒƒ|jd|jdƒjdƒƒ|jd|jdƒjdƒƒ|jd|jdƒjdƒƒ|jd|jdƒjdd ƒƒ|jt|jdƒjƒdS( Ns abc Ri s abc iiis ***abc****R3(R(RtcenterR R(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyt test_center~s """"%cCsB|jd|jdƒjƒƒ|jt|jdƒjdƒdS(NshEllO CoMPuTErSsHeLLo cOmpUteRsR&i*(R(RtswapcaseR R(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyt test_swapcase†s cCs¸|jd|jdƒjdƒƒ|jd|jdƒjdƒƒ|jd|jdƒjdƒƒ|jd|jdƒjdƒƒ|jd|jdƒjdƒƒ|jd|jdƒjdƒƒ|jd |jd ƒjdƒƒ|jd |jd ƒjdƒƒ|jd |jd ƒjdƒƒ|jd |jd ƒjdƒƒ|jd |jd ƒjdƒƒ|jd|jd ƒjdƒƒ|jt|jdƒjƒdS(Nt123iit0123is+123s+0123is-123s-0123t000Rt34it0034(R(RtzfillR R(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyt test_zfillŒs""""""""""""cCsy|jd|jdƒjƒƒ|jd|jdƒjdƒƒ|jd|jdƒjdƒƒ|jd|jdƒjdƒƒ|jd|jdƒjƒƒ|jd|jdƒjdƒƒ|jd|jdƒjdƒƒ|jd |jd ƒjd ƒƒ|jt|jd ƒjd d ƒtjdkrutjdƒdkru|jt |jdƒjtjƒndS(Nsabc ab def g hisabc ab def g hiisabc ab def g hiisabc ab def g hisabc ab def g hisabc ab def g his a bs a biR&i*i tPs a bI( R(Rt expandtabsR Rtsystmaxinttstructtcalcsizet OverflowError(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyttest_expandtabsœs&       ""$ cCsÝ|jd|jdƒjƒƒ|jd|jdƒjƒƒ|jd|jdƒjƒƒ|jd|jdƒjƒƒ|jd|jdƒjƒƒ|jd |jd ƒjƒƒ|jt|jd ƒjd ƒdS( Ns Hello s hello sHello shello sFormat This As Title StringsfOrMaT thIs aS titLe StringsFormat,This-As*Title;StringsfOrMaT,thIs-aS*titLe;StringtGetinttgetIntR&i*(R(RttitleR R(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyt test_title³s  cCsV|jddddg|jdƒjƒƒ|jddddg|jdƒjƒƒ|jdddg|jdƒjƒƒ|jdddg|jdƒjƒƒ|jddddg|jd ƒjƒƒ|jdddddg|jd ƒjƒƒ|jd d d ddg|jd ƒjdƒƒ|jt|jdƒjddƒdS(NRtdefRtghis abc def ghis abc def ghis abc def ghis abc def ghi sabc def ghi s abc def ghi s sabc sdef sghi s ii*(R(Rt splitlinesR R(R((s-/usr/local/lib/python2.7/test/buffer_tests.pyttest_splitlines¾s(t__name__t __module__t__doc__RRRRRRR R%R*R-R2R5R7R9R;RBRJRNRR(((s-/usr/local/lib/python2.7/test/buffer_tests.pyRs(           (RGREtobjectR(((s-/usr/local/lib/python2.7/test/buffer_tests.pyts