ó {G_Tc@s¡dZddlZddlmZddlZddlZddlZd„Zdejfd„ƒYZ de fd„ƒYZ d „Z e d kre ƒndS( s< Tests common to genericpath, macpath, ntpath and posixpath iÿÿÿÿN(t test_supportcCs)ytj|ƒWntk r$nXdS(N(tostrmdirtOSError(tdirname((s1/usr/local/lib/python2.7/test/test_genericpath.pyt safe_rmdir s t GenericTestcBsqeZeZddddddddgZgZd„Zd „Zd „Zd „Z d „Z d „Z d„Z RS(t commonprefixtgetsizetgetatimetgetctimetgetmtimetexiststisdirtisfilec Csixb|j|jD]P}|jtƒ9t|j|ƒƒ|jdj|jj|ƒƒ‚WdQXqWdS(Ns!{}.{}() did not raise a TypeError( tcommon_attributest attributest assertRaisest TypeErrortgetattrt pathmoduletfailtformatt__name__(tselftattr((s1/usr/local/lib/python2.7/test/test_genericpath.pyttest_no_arguments  c Cs–|jj}|j|gƒdƒ|j|ddgƒdƒ|j|ddgƒdƒ|j|ddgƒdƒ|j|ddgƒd ƒ|j|d d gƒd ƒ|j|d d gƒd ƒdd dddddddddg }xž|D]–}x|D]…}|||gƒ}|j|j|ƒƒ|j|j|ƒƒ||krt|ƒ}|j|||d!|||d!ƒqqWqøWdS(Nts/home/swenson/spams/home/swen/spams /home/swens/home/swen/eggss /home/swen/shome:swenson:spamshome:swen:spams home:swens:home:swen:spams:home:swen:eggss :home:swen:tabctXbcdtXbtXYtabcdtaXctabdtabtaXtabcXi(RRt assertEqualt assertTruet startswithtlentassertNotEqual(RRttestlistts1ts2tptn((s1/usr/local/lib/python2.7/test/test_genericpath.pyttest_commonprefix!s@      cCszttjdƒ}z:|jdƒ|jƒ|j|jjtjƒdƒWd|jse|jƒntj tjƒXdS(Ntwbtfooi( topenRtTESTFNtwritetcloseR&RRtclosedtunlink(Rtf((s1/usr/local/lib/python2.7/test/test_genericpath.pyt test_getsizeKs  #  cCsêttjdƒ}zª|jdƒ|jƒttjdƒ}|jdƒ|jƒttjdƒ}|jƒ}|jƒ|j|dƒ|j|jj tjƒ|jj tjƒƒWd|j sÕ|jƒntj tjƒXdS(NR1R2R#tbartrbtfoobar( R3RR4R5R6treadR&tassertLessEqualRR R R7R8(RR9td((s1/usr/local/lib/python2.7/test/test_genericpath.pyt test_timeVs"        cCsÍ|j|jjtjƒtƒttjdƒ}zk|jdƒ|jƒ|j|jjtjƒt ƒ|jt ks›|j|jj tjƒt ƒnWd|jƒs¸|jƒntj tjƒXdS(NR1R2( tassertIsRR RR4tFalseR3R5R6tTruet genericpathtlexistsR8(RR9((s1/usr/local/lib/python2.7/test/test_genericpath.pyt test_existsls    cCsø|j|jjtjƒtƒttjdƒ}z‰|jdƒ|jƒ|j|jjtjƒtƒt j tjƒt j tjƒ|j|jjtjƒt ƒt j tjƒWd|jƒsÖ|jƒntjtjƒttjƒXdS(NR1R2(RBRR RR4RCR3R5R6RtremovetmkdirRDRR8R(RR9((s1/usr/local/lib/python2.7/test/test_genericpath.pyt test_isdir{s    cCsø|j|jjtjƒtƒttjdƒ}z‰|jdƒ|jƒ|j|jjtjƒt ƒt j tjƒt j tjƒ|j|jjtjƒtƒt j tjƒWd|jƒsÖ|jƒntjtjƒttjƒXdS(NR1R2(RBRRRR4RCR3R5R6RDRRHRIRR8R(RR9((s1/usr/local/lib/python2.7/test/test_genericpath.pyt test_isfileŒs    ( Rt __module__RERRRRR0R:RARGRJRK(((s1/usr/local/lib/python2.7/test/test_genericpath.pyRs   *   t CommonTestcBsçeZd$Zejdddddddddd d d d d dddddddddd dgZd„Zd„Zd„Ze j e j dƒd„ƒZ d„Zd„Zd„Zd „Ze jejd!kd"ƒd#„ƒZRS(%tcurdirtpardirtextseptseptpathseptdefpathtaltseptdevnulltnormcaset splitdrivet expandvarstnormpathtabspathtjointsplittsplitexttisabstbasenameRRFtislinktismountt expandusertrealpathcCs8d}|jj|ƒ}|j||jj|ƒƒdS(Ns FoO/./BaR(RRVR&(RR.((s1/usr/local/lib/python2.7/test/test_genericpath.pyt test_normcase®scCsR|jj}|j|dƒdƒ|j|dƒdƒ|j|dƒdƒdS(Ns/foo/barRsfoo:bars:foo:bar(Rs/foo/bar(Rsfoo:bar(Rs:foo:bar(RRWR&(RRW((s1/usr/local/lib/python2.7/test/test_genericpath.pyttest_splitdrive´s cCsa|jjdkr"|jdƒn|jj}tjƒ!}|jƒd|dXtj |ƒ,x$d D]}|j||ƒtƒqŠWWdQXdS( Nuufuuufùùu/fuuuU:\uçwðtascii(uufuuufùùu/fuuuU:\(uufuuufùùu/fuuuU:\( RRZR}R‚RtTESTFN_ENCODINGRwtAttributeErrortUnicodeEncodeErrorttemp_cwd(RRZRtunicwdt fsencoding((s1/usr/local/lib/python2.7/test/test_genericpath.pyttest_abspath_issue3426ûs   tdarwinsEMac OS X denies the creation of a directory with an invalid utf8 namecCs$tjdƒ|jƒWdQXdS(Nsçwð(RRˆR€(R((s1/usr/local/lib/python2.7/test/test_genericpath.pyttest_nonascii_abspathsN(RRLtNoneRRRRdReRntunittestt skipUnlessRRvR{R€RRƒR‹tskipIfRttplatformR(((s1/usr/local/lib/python2.7/test/test_genericpath.pyRM¡s"         cCstjtƒdS(N(Rt run_unittestR(((s1/usr/local/lib/python2.7/test/test_genericpath.pyt test_mainst__main__( t__doc__RttestRRRERtRtTestCaseRRMR”R(((s1/usr/local/lib/python2.7/test/test_genericpath.pyts     Žu