%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_largefile.pyc

ó
Nêáac@s
dZddlmZddlZddlZddlZddlZddlmZm	Z	m
Z
mZmZddl
Z
ddlZy(ddlZejejejƒZWneefk
rÇnXdZdejfd„ƒYZd„Zed	kreƒndS(
s9Test largefile support on system where this makes sense.
iÿÿÿÿ(tprint_functionN(trun_unittesttTESTFNtverbosetrequirestunlinkIù•t
LargeFileTestcBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(s@Test that each file function works as expected for a large
    (i.e. > 2GB, do  we have to check > 4GB) files.

    NOTE: the order of execution of the test methods is important! test_seek
    must run first to create the test file. File cleanup must also be handled
    outside the test instances because of this.

    cCs­trtdƒn|jtdƒ‚}|jdƒ|jdƒ|jtƒ|jdƒ|jƒtrytdƒn|jt	j
|jƒƒtj
tdƒWdQXdS(Ns3create large file via seek (may be sparse file) ...twbtzitascheck file size with os.fstati(RtprinttopenRtwritetseektsizetflushtassertEqualtostfstattfilenotstattST_SIZE(tselftf((s//usr/local/lib/python2.7/test/test_largefile.pyt	test_seek&s






cCs;trtdƒn|jtjtƒtjtdƒdS(Nscheck file size with os.stati(RR
RRRRRR(R((s//usr/local/lib/python2.7/test/test_largefile.pyttest_osstat3s
cCs\trtdƒn|jtdƒ1}|j|jƒdƒ|j|jdƒdƒ|j|jƒdƒ|jdƒ|j|jƒdƒ|jddƒ|j|jƒdƒ|jdƒ|j|jƒdƒ|jddƒ|j|jƒdƒ|jddƒ|j|jƒdƒ|jddƒ|j|jƒdƒ|jddƒ|j|jƒtddƒ|jd	dƒ|j|jƒtdd
ƒ|jtddƒ|j|jƒdƒ|jtƒ|j|jƒtƒ|j|jdƒdƒ|jtddƒ|j|jdƒdƒ|j|jƒdƒWdQXdS(Ns;play around with seek() and read() with the built largefiletrbiiRi*iTiiöÿÿÿi
R	(	RR
RRRttelltreadR
R(RR((s//usr/local/lib/python2.7/test/test_largefile.pyttest_seek_read8s<



c	Csˆtrtdƒn|jtdƒ]}|jtj|jƒddƒdƒ|jtj|jƒddƒdƒ|jtj|jƒddƒdƒ|jtj|jƒddƒdƒ|jtj|jƒddƒtddƒ|jtj|jƒddƒtdd	ƒ|jtj|jƒtddƒdƒ|jtj|jƒtdƒtƒ|j|j	dƒd
ƒWdQXdS(Ns4play around with os.lseek() with the built largefileRii*iiTiiöÿÿÿi
R	(
RR
RRRRtlseekRRR(RR((s//usr/local/lib/python2.7/test/test_largefile.pyt
test_lseekYs
%%%%--*%cCs«trtdƒn|jtdƒ€}t|dƒsItjdƒ‚n|jddƒ|j|j	ƒt
dƒt
d}|j|ƒ|jƒ|j|j	ƒ|ƒ|jddƒ|j|j	ƒ|ƒ|d8}|jd	ƒ|j|ƒ|jr|j|j	ƒd	ƒn|jddƒ|j|j	ƒ|ƒ|jdƒ|jdƒ|jrx|j|j	ƒdƒn|jdƒ|jt
|jƒƒdƒWdQXdS(
Nstry truncatesr+bttruncates.open().truncate() not available on this systemiiii
i*(RR
RRthasattrtunittesttSkipTestR
RRRR tnew_iotlenR(RRtnewsize((s//usr/local/lib/python2.7/test/test_largefile.pyt
test_truncatehs4






	

	
cCsr|js|jdƒnxRddd
fD]A}|jtdƒ'}|j|ƒ|j|jƒƒWdQXq)WdS(Ns$builtin file doesn't have seekable()iiiRI€iÿÿÿI€I€I€(R$tskipTestRRR
t
assertTruetseekable(RtposR((s//usr/local/lib/python2.7/test/test_largefile.pyt
test_seekableŒs	
(	t__name__t
__module__t__doc__RRRRR'R,(((s//usr/local/lib/python2.7/test/test_largefile.pyRs	
		!		$cCstjd dks"tjdkr<tddttƒƒn„ttdddƒ}y(|jd	ƒ|jd
ƒ|j	ƒWn:t
tfk
rµ|jƒt
tƒtjdƒ‚nX|jƒtjƒ}xtjdftjd
ftdfgD]ö\}}dtfd„ƒY}t|ƒ|_|tk	|_|tj|_|j|dƒƒ|j|dƒƒ|j|dƒƒ|j|dƒƒ|tdƒ,}t|dƒrÇ|j|dƒƒnWdQX|j|dƒƒt
tƒqôWzt|ƒWdt
tƒXdS(Nitwintdarwint	largefiles-test requires %s bytes and a long time to runRt	bufferingiI€txs*filesystem does not have largefile supporttCtPytBuiltintTestCasecBseZRS((R-R.(((s//usr/local/lib/python2.7/test/test_largefile.pyR8´sRRRRR R'R,(tsystplatformRtstrRRRR
RRtIOErrort
OverflowErrortcloseRR"R#t	TestSuitetiotpyioRtstaticmethodR$R-taddTestR!R(Rtsuitet_opentprefixR8((s//usr/local/lib/python2.7/test/test_largefile.pyt	test_main—s@"




t__main__(R/t
__future__RRRR9R"ttest.test_supportRRRRRR@t_pyioRAtsignaltSIGXFSZtSIG_IGNt
oldhandlertImportErrortAttributeErrorRR8RRGR-(((s//usr/local/lib/python2.7/test/test_largefile.pyt<module>s$({	0

Zerion Mini Shell 1.0