Your IP : 216.73.216.213


Current Path : /opt/alt/python34/lib64/python3.4/test/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/test/__pycache__/buffer_tests.cpython-34.pyo

�
f fn,�@s2ddlZddlZGdd�de�ZdS)�Nc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(S))�MixinBytesBufferCommonTestszITests that work for both bytes and buffer objects.
    See PEP 3137.
    cCstd��dS)z4Convert x into the appropriate type for these tests.z(test class must provide a marshal methodN)�RuntimeError)�self�x�r�6/opt/alt/python34/lib64/python3.4/test/buffer_tests.py�marshalsz#MixinBytesBufferCommonTests.marshalcCs�|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)	N��a�As
sabcsaBcsabc
�*)�assertFalser�islower�
assertTrue�assertRaises�	TypeError)rrrr�test_islowersz(MixinBytesBufferCommonTests.test_islowercCs�|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)
Nr	r
rs
sABCsAbCsABC
sabcr)r
r�isupperrrr)rrrr�test_isuppersz(MixinBytesBufferCommonTests.test_isuppercCsW|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)Nr	r
rs
sA Titlecased LinesA
Titlecased LinesA Titlecased, LinesNot a capitalized StringsNot	a Titlecase StringsNot--a Titlecase StringsNOTsabcr)r
r�istitlerrr)rrrr�test_istitle$sz(MixinBytesBufferCommonTests.test_istitlecCs|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)Nr	r
� s	s
s
s 	
s 	
asabcr)r
r�isspacerrr)rrrr�test_isspace2sz(MixinBytesBufferCommonTests.test_isspacecCs�|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)	Nr	r
rs
sabcsaBc123sabc
r)r
r�isalpharrr)rrrr�test_isalpha=sz(MixinBytesBufferCommonTests.test_isalphacCs|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)Nr	r
rs
s	123abc456sa1b3csaBc000 sabc
sabcr)r
r�isalnumrrr)rrrr�test_isalnumGsz(MixinBytesBufferCommonTests.test_isalnumcCs�|j|jd�j��|j|jd�j��|j|jd�j��|j|jd�j��|j|jd�j��|jt|jd�jd�dS)Nr	r
�0s
0123456789s0123456789asabcr)r
r�isdigitrrr)rrrr�test_isdigitRsz(MixinBytesBufferCommonTests.test_isdigitcCsa|jd|jd�j��|jd|jd�j��|jt|jd�jd�dS)NshellosHeLLor)�assertEqualr�lowerrr)rrrr�
test_lower[sz&MixinBytesBufferCommonTests.test_lowercCsa|jd|jd�j��|jd|jd�j��|jt|jd�jd�dS)NsHELLOsHeLLoshellor)r!r�upperrr)rrrr�
test_upper`sz&MixinBytesBufferCommonTests.test_uppercCs�|jd|jd�j��|jd|jd�j��|jd|jd�j��|jd|jd�j��|jd|jd�j��|jt|jd�jd�dS)	Ns hello sHello shello sAaaasaaaasAaAashellor)r!r�
capitalizerr)rrrr�test_capitalizeesz+MixinBytesBufferCommonTests.test_capitalizecCs�|jd|jd�jd��|jd|jd�jd��|jd|jd�jd��|jd|jd�jd��|jd|jd�jdd	��|jt|jd�j�dS)
Ns
abc       sabc�
sabc   ���s
abc*******�*)r!r�ljustrr)rrrr�
test_ljustns""""%z&MixinBytesBufferCommonTests.test_ljustcCs�|jd|jd�jd��|jd|jd�jd��|jd|jd�jd��|jd|jd�jd��|jd|jd�jdd	��|jt|jd�j�dS)
Ns
       abcsabcr(s   abcr)r*r+s
*******abcr,)r!r�rjustrr)rrrr�
test_rjustvs""""%z&MixinBytesBufferCommonTests.test_rjustcCs�|jd|jd�jd��|jd|jd�jd��|jd|jd�jd��|jd|jd�jd��|jd|jd�jdd	��|jt|jd�j�dS)
Ns
   abc    sabcr(s abc  r)r*r+s
***abc****r,)r!r�centerrr)rrrr�test_center~s""""%z'MixinBytesBufferCommonTests.test_centercCsB|jd|jd�j��|jt|jd�jd�dS)NshEllO CoMPuTErSsHeLLo cOmpUteRsshellor)r!r�swapcaserr)rrrr�
test_swapcase�s	z)MixinBytesBufferCommonTests.test_swapcasecCs�|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)Ns123r+r*s0123�s+123s+0123�s-123s-0123s000r	s34�s0034)r!r�zfillrr)rrrr�
test_zfill�s""""""""""""z&MixinBytesBufferCommonTests.test_zfillcCs�|jd|jd�j��|jd|jd�jd��|jd|jd�jd��|jd|jd�j��|jd|jd�jd��|jd|jd�jd��|jd	|jd	�jd��|jd|jd�jd
d��|jd|jd�jd
d��|jd|jd�jd
��|jt|jd�jdd�tjdkr�tjd�dkr�|jt	|jd�jtj�ndS)Nsabc
ab      def
g       hisabc
ab	def
g	hi�sabc
ab  def
g   hir5sabc
ab      def
g       hisabc
ab	def
g	hisabc
ab  def
g   hisabc
ab
def
g
hi�tabsizes  a
 bs 	a
	br7shellor� �Ps	a
	bl)
r!r�
expandtabsrr�sys�maxsize�structZcalcsize�
OverflowError)rrrr�test_expandtabs�s.									""$	z+MixinBytesBufferCommonTests.test_expandtabscCs�|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;StringsGetintsgetIntshellor)r!r�titlerr)rrrr�
test_title�s		z&MixinBytesBufferCommonTests.test_titlecCs�|jddddg|jd�j��|jddddg|jd�j��|jdddg|jd�j��|jdddg|jd�j��|jddddg|jd	�j��|jdddddg|jd
�j��|jdddddg|jd
�jd��|jdd
dddg|jd
�jd��|jdddddg|jd
�jdd��|jdd
dddg|jd
�jdd��|jt|jd�jdd�dS)Nsabcsdefr	sghisabc
def

ghis
abc
def

ghisabc
def
ghis
abc
def
ghi
sabc
def
ghi

s
abc
def
ghi

Fs
sabc
sdef
sghi
s
T�keependsr)r!r�
splitlinesrr)rrrr�test_splitlines�s*z+MixinBytesBufferCommonTests.test_splitlinesN)�__name__�
__module__�__qualname__�__doc__rrrrrrrr r#r%r'r.r0r2r4r9rCrErHrrrrrs(


		r)rAr?�objectrrrrr�<module>s