ÿØÿà JFIF    ÿÛ „ !.%+&8&+/1555$;@;4?.451 4,$,44444444444414444444444444444444444444444444444444ÿÀ  á á" ÿÄ     ÿÄ ?    !1AQaq"2‘¡±ÁðBRbrÑá#‚’¢²3S CñÿÄ   ÿÄ !    !1QAa‘2ÿÚ   ? 5˜Z¯V¦cø)›t/? z¨±>Õ5€¶‹Á¤·¼z¼Ü¬+ñ®v¤¨_ˆR­BFn©—˜ý®ç̝P8gýt·ÉSTŦˆìät?þé¼íìN/Þa)ì–í6ô… Ï¿øÃj´¿KÇü]ÿ ªô¹-eKànëÕHTx}ýSÜ›ÿ ”7Ø×&µ<¦  ¥ÑO¶[Ù¯ä¨ÞÃÿ PZ-¬;#õ|•oaÿ ©CìÞz3˜öː/¤­ñTûIØ}š^ mÓ%ªxˆ¥ÉŸu=Z+ISe¿45™¼u;ú&WØ÷€æßQ™®{|íx*TC“#ZŠìZ§²‹ 6pv…³¿¡äª*áZÐ%ÒOáˆo"x«OHk w±æ+¬V(kMúŸ5Vö«$ ÁrÏbàb57/luR ¸ÑÛj Òµì`Мq­û žICÀÊ•©4€Âcà¨Ï€O´<èÐ:›ù(Ë^L8þ‘ÍÌ#¸Ð_Ì©ÙK(Öz 4¬û+¸;ü’V’84‘¬ÃŽ:[â‡ÔÌáõp¢~§ªlæ£ö{®G>J¼"°‡7¯ÆÉèßû ‹É‹§ÁòÃýâßî ^ƾÙõ‹×óH#«LP½ïX=xÑÍ$|W?•~• îëÔ©ª‹ {ÝT…Kÿ ”hûâá)J*ö˜–ÔU;iÇ€/ ÆþjóZ\ýwØ=Ìm ºèËL9 ýèÆð/¨’¥öo=nË.%Îì ŽÕ¯È|{Oj²ƒE6e/ßdÄõ²Ìâ1O®ò×TsəԸhOMýíMˆ¿¼H˜l²,7Â¥#MF/Úf°Ö½± ¸–dr‹NýÊ íjqx{œÉ ä-È ¦ øÄër¨q°ð †nцýÑÄÆ’mä…n<0È™;ÁÝá¯ÁZƒ7FÀmì­ É&9ˆîéi¶ùN§Y• ÃZãAâ?•‡©‰ , ó¾IŸŠc1 4â&y­&pŠ­6;M À 0¹qç»p.á …ŸÅáK@%6·y6ƒ‰3?”úºŽ‰éX5ªPT §µ!=Mž«Ú½‹ÅgÂSâÉaþÓoö–¯ÁÔìR>5éÿ üs¶ÆUcÌ kÇR ]ÿ ù¬¼«VŽ;Â|‡~¢¦”ÏŰæ {L™Õ°Óv¹ò¸írޡעCÃ!íVÕ {¶»sŒNPg/ "uÕbkm²“$ďå¿é¹§°½æz¯6 †s¿!s–wÚÝ“™Œ °.ûj>·+™Òa…©Œ&rÝÎtÛë긪Ît’LAVp%c Úý[ÄzJ¾ÇàXXç@˜ó<êL]·T˜¾¥1Ó©V‡g´æ½¦Ý@¹óø!_@´ÞâSÁ —S3™•& ]@JHÚý©ZŽ €×æÔr»Áf!‡yÞ4Mv*èÓã_{‘åóUuљØ«Oïé*®EvÑ Œ÷‡U \"㪒ÍK+À 4“M¡ï:0¥5í!'<@î´”>Ç»&Z–ïCCV˜Ì5Šo&îhè.žû |ÓK©h$s6KìŒëã)¹hI¦GïOåóI;ììü#É$Š0…Ææ¥TØ.5­¾gn´ “ÂÖ\:hœ89G)J@„}œ:’Ò{/Š"¦_Æ×7Æ3VÇŠÊa]ÚŒÙ€Ä–=®uÁßâACZƒ§§£ Qnâ:«,×{tyø¬iÛcœÜÄ€H½ÄÍCk´÷šß .W'b¤Íåh]÷€=,Žv×cÚEÚHXJX¶îo¨FÒtèöŸ>ªª6[J®Fµ£sGÁeqõfe\íjÒÐïÄÐGˆe1Ø‹.Ø”‘Ëuø Y­ˆÜ ŽG|zùªüMpDnQWÄ”%JŠ™)â*p@Örš«ÕT2Ð%ˆG#ª„ ·¤!°ŸOTÂT¸aÚ%4&h™LµšØüÐ.F¿²ÐÞ_Ç‚¾ÅÃaÜ÷09Æ q€öy˜v‡85õN÷]¬äѼóS{°_MެúÔ#°Ç¸0åÞè2ëôPcvÆw9®ií1Ä8F™˜à‰´+‰Ik1òÝ7“Ñ×ÒsÝ\x‚h`ÞÑ`ó"|µEcý£n˜h`}GÞ !±ù²Ápü²ß6 0ïi󜵩SÈÇ7˜-ÕURO˜¦´f$ªž-Í6(œ}<„ éc øs]ŽŽ„*—¾ ìdŽ„)méª\¿êÎIg¾ØÞ~I#C/¼¼´EÁÈŽi8“©õådô·>euä ƒ'Ê×लR1ÉJE1ÐAát`t;ÇР%Ý<‡¥„ÍÆ`×Oyó)õiI€ñQaŸ4Ûù\áàaÃÔ¹HÃu¹*k€¦<„e S‡&õÏ B!ŽhüÞ`yj}mªf×\¿ Ç~æ­9‡û\՞Ǖg²1Žû5V7 !àöšm° c`ܬøÇìµÒ'P"?…´Ö,"§^•õލsÔ)6˜sæéÍR¼ ò|Sl”‹7 nPW Gòú÷½§O¯‡„l¡kSÞŒr½PÊ@æ¢pŽ-mÿ #Ÿ˜Àº¶Áä¦;ïÔæ$1££`“Õ>„—·ž)ßð³ñ#Ï Ô$¶œ‰ÊE‹À;÷º ¯«P:Ñ”8–IÊtpÞ3ª“>ê“þës4ò2OÏÕ­±zô†Õ§‰.÷ä¸;¿˜“'œ›žª}«Œ{ª±Ì 9ÔóÞÕ‡0 $íWV3Üì¬ —@kÝ4@¿r¼±½¬™›?øØæ´'Áé®CË3-g$˜ö‡×auÚi´Žp/êÛ æF›Ú2v‹ã¿¿,nB1̨ƃqÞa5͝@&Æû“él÷ \C²½UÍc ¯k×¢U ÖéQå™—-r wô ÞÏ<Ò=&=ÿ Ôê Òêˈt,i—;LîÜ á¸*ÚÃ1$êL•LÍ <É)ýÐà’ ;F™{ƒ™˜€&'}‚ãÄK`¡ÞT@I;®žZóè‚s’7®°›+§O­Åq©é»²9<Ô J ¼9O’HL»Ùïì¸rk¼Ž_ý‘TŸu[²ßÚŒ·ü÷B%¯E ŸÔX5êO´ Ç•€’I0 ÉJX` ñ¹õ%;µŸD‘«´€àwÒ™U ûئžÖö\×®×´8 ½‡ºÐÆÓ§?Àkmœ=;d5*@-ì0F Rªýš[Ü6âö̃ڸr*KA9· u*µæ£?U¸Âêí†8@¦X4 e-ò„0s{ HâUpU?¼mñRa°®a%Ð'tÉ×’\¾ÊÉ]t›h>·(Ë@R¼¡Ãt h}’O÷au<+nT…Ö…MӐ??Óe95 q>í/;&JSû °¯ÊéÞ øƒ*Ã2½Ài&:nôUl=¾¿5eˆ3”ñc|Ú2V”>„»&eE;«ÚäC p¢Û úy 9š[ŒÌx¼擼A&DåÒ¯ˆ¤ÀÌ;"˜ ÏQä¸åhÊ}Ûq«Û0WžÒ|»€ø®öCm5•\ÇÀ§Pe3£]0ÃàLDÉ‰1øªxjgwT‚÷¿LΨK‹›ùs—xˆÜ±µ kæ¸f‰‰ÜGk/LÛØ6d9ò¶ùA{ƒA3š/¬D¬khÓk‰`˜"㯒r¿±Óã jx‡°e}<Ñø\3y:'À•/h½Í€Ç4~g ?Û(¼]v‘ªlKÎâ~?O‚W%{Ì:“'©úNq¾›úo(X’¥¯ˆ nFê{Ç€ü?º'ë ø‹ì Þ09ŒÌç9Æ —ËC`j@ÓÄ(+a‹un¸#ÂꟋ{K`‘ÑÍÍ'à´»/Û,KW;Þ4²þð ï Nm|~fGÏ(…³Ã)«1ö­Õ ¥‡¨©ƒÃ™ü-s=à=U66Ï«Ýc蓦W¹íž®›nÔ%êÇìŒ<#Ü×84ån®Ð ÒåOC` ñânÑs‡¢ç 1õ%Îhì½Ã½® e:ݼUZo™`  ÅZŸŒÊ«ê1ÏÄo$q¹Þ€©ˆhÐÉä¯ñ[!…Ú˜àJ:x2$Íß&PåT£6ç— ‡Í*4Ýšçjÿ ‰É nófÐ ó(L5C•åÆ\rMÒ@ò }y-W}™üýVù—ú¢=Ù”c®‘< M ž ´Phr ¦©TD ‘ù.$´÷O‡‘V2Æò.=IUŒ=ž‡â¬i™aþÓåÙ?òUø'ØÖ•.~* šTŒ!•-×áºTâ®ä#õü'´ eýlYÅÓeÕKÂrT"CÚ@u!Óxƒ{š3€}1¿(r}%«nËamjÑ%ÑNEò v ˜à  σöK³,*º.àzù¨™Ó ÚçâU¦*¿ 9{%Ö¹ njûdaXöb) kÛÆ±ûÓ\°M7ˆÂ=û›ç¿Ã‚­V»Cg–8ÙêE- j)k$º`Ã-ùEýeBÆÇ]c¡°ñty&Òd0nõ'¡W+ƒ*|–øµFa\GQªEAÔp5\Ǽ·¼Ç8·õ -â§Ú[ ‡ uZeÖ 3}×d'+¹:ð+K†Û®s!Ï$úe€<Û”x)1»a­¡LC]¸µík…ÚàA»AYº{†ªS[¦5HÒ7ù --,ísòDØ€èk ÞÀîÜ ò@â( ËNˆë›4ô½•/¦o‡€Û7 ê•ÆêòðÜy'Án½µ á˜ݦ ndeo…[ì¶Ê,¥R³Ä=À±—–ß;£™´ñSâ*g§”ïaið‘Jå~™ÓÞ ß³Õ¢»8x埒²52>AÊb&-÷\7´éÄù€T˜,w;3{ï˜k…à¹ÄqÀ«œ{€\ ˆ¾[´¨јr &Úé„Ívˆ±8†¿]|¬ņ4I×pÞS1ÈÖz‰#Ìv‡G!YNògñ:màTz¢Ý1ô©^O=~ë|5Bã™ç•¼µõ•bÆ@úÕS¬ÈŒ#¬zünrŸ û” Z²•èðV"ÁHÚý©wÝ €7¼Ìu1hÑa3Éä û f$o¿É ™Ú›ÝçnpÒ3äÌ3†Í§,Äï]$‰/pê †«À¼¸e9­Æê_C]žƒ·ý·frÁN«, E=›Çq -‰öŒ:aÏ¿±í&£Í:-} 84‘ÿ eƒQÑeëSsuiA ³g㟥ú£?ÿ ʼn*”“÷aühe:ÊWa@ÒÞk±eØ] F Ô—r.åä˜ @ö¥ªZoÐýYL·¥S²G/‡ñ <~*ZÆ´è>JlòàÛÆ½ÿ 窘ìGN¢:I®KšJp/`íIÁÀõ#Ä-€ö­šµŒoF4|ÆQØÆ@Ì|£Ô…¢À{9˜è½Üó›€ôYÒÎYsið;ís¤€à²ˆ‚4qÉVŒI$ ‰"° æµ8cXGjœˏ¡Aâý•ËÜ¢ûï e·çLx']á"oÅÎê3¯Ç—¹”ó0nå‚âg{Œñ> S´˜îè°g238‚ãköÝfÚd´6Ò€;ò÷±¢™¼›º ¢Æ'¥Ðx'e¬ç ]bÈÆV¢ó‹kýBO ðÊâ$Ÿ!×T 3Mýמ žìٍàÌü‘8÷€àæØ8æ©6‰©L´«…oãpð„~Çk‰!ñ;‹”ÛžÍ àž±z Ÿôû øŸÝužÏ;ÿ #|u6™Þ¬ÚˆÐõA4¶â|ôl|Ê2ŽÇ¤ÝÅÇY.<#Aí.k§hóF‚”Y; M½Ö4hŸ4&›­¿tès´%FìL¥£Ãk‰ÇT¤haÁ¤ÚxfÉ`ÑìË›>i 3t‚:,–+^÷´–{Û–Nxi"x‘Ûg î¨>¥Õ܁ùZH,2Û“:8xÊ¢Çí9.É-Ìâã-=çjwµS˜dütžçwýGòú®®ûº_ˆýx$–¡ãøO EÚÛÏ÷R„×w+3£Á£öUMyR²¹âŒ°š›¸Ñãò9§Ó_Dl+Ùßc›úšGÅÌc†Ž!Ko=¶.‘Îÿ c²(2®V mª.ÿ ¹B›¹å ù„öŸSV>™ü¯$y:G¢Z×àøúdî¹û­·ýÇ´:•c LÍõi_‹ö+ÎæGÊè>OŠ•äž´§Þ{X}¨1ÚTc›»Qþ•êô°t¿OP?eæ~É{5]•ÙR£r5†nZ\ã@ &îJõ ¾àC°þV>fé¥/ü5ñÊIº_é5 ;e­h<@ Ä&æÃëE%;X,ÒãÆÞ`Oò¦kŸm#˜!ÀyÄ¢| óLšò¥Ä` ¶R=|ÈCâh5ò3DˆïF†ðÒ#ÅìÛœ?¸yhBãœí ZxßÎÄhºRK„`Þödvײ™ÀÈÑÒgŒuY w³%†ƒÓzõ ÖÏp‚dH®¦A´ù§»ÓÇMæ~)ˆð‡û:ù&Ä •vGD´À n ݇¼Ö8Fö óáà£~Ë¥x`oK|Ä?fxiØü%pìR>éò+Û±éÎ>núlFŤ'tq8LZÏvÃ?„¡ß±È⽆¯³íü@x|PöUäèØã¡ð‚ŒAìÏ"vÍwóŸÍ{ ý0.z È•Ö{,N¡£¡ŸKÕÙž>Ýœþ ÍÀ°<×EA!Å‚D™IúOÍ¡>ôG}Â` ÍßkÜL™Ž Þð™ {IøF²¹òQ3&!ÃÂÞz.d&Ï-sH¸,Ôõ˜ŽP€ 77ˆÝ¼ÊëÜw =cÕ Ú,ØÐ5ÎYÐ)ì´öœgŒ[¤ßv㙑8心>h]§µháYš£²ºÑ.{Ï7Sð•?´~×SÃKýJÛ˜ ™Íäiúu<µX¶1õ^kâçIÑ£sZ4h>j*ÔšD:4­¿_ ÷¸ Õxæÿ ¸?Mù _•­ÊÐ ä ÷ý ÑwL œ­ïnTkÛUÍN©ë:¦fV ¶ÜÔÜMªÅâA½–¿R×TXš-%iTÊT•‡Ù‚JôϐZxWÑè‰f‰òG º ×Õû2aZ7OU3[“×AT–ÞŒ…-‘¤”Ì ì&(ˆ¿­•ƒkï’:ðY¦W‘ Å)“†‘˜³Åtcø˜ñTÂwÚÇ4|üLÇªí–v- qˆèU qPE.†â‘˜µ Æ,ÐÅs]8¾„oúÑ i>ÜxxÈó)ƒ ´æÁâØ$À‰vžŸf$Ž |ãw;ÀÁIJ»b` {¦Ó¤Ú$©YÀ‘n@Óïž«9J¼êG m¤ ܯ¹ÌW4€ÐÒÅÛ‡#褕Ÿn-?í|с¥÷Ú¹¬'´ÞÜ9ÓK `hê£SÄSà?7—Wí_´…óB›»:=Ãïq`<8ñÓŒÑlú2d¬ê³£hÖ[l|$vÝro~'R®‰§°ñmY ͧäP |PUª¹·:3Œ[Û{Xÿ ºâ@‚W–Äé u‚ ¯´*=íή.pûÒdt @G‰¬ s¸ ëÉücr ÞæÑ¨Ê@>¤¢Ö±. Þ'¯°ÌME[YéïĵÂCå½ Ué©Áû'Ê9%eÔðNU”ë‘ÌsD3/®+UI˜9h.WC”빓$#:pz:YÓ ¿xž* ³$Í +$kñAŠ‹†¢ Uê>¸)_š¬÷©ßAÂÔb9ÇU ¯¾á•9¯ÏÏ÷O÷¼¼Fähal1‰3Ì[Ïr•´UCksNÐ] R‘¸¥H+§Šé†c©vÖÞ0iÓ76s†î!§=ß ¼~Ô'°Ãmäoäš³ªøi1úÉ)³yV8 CLÄØÁ‘WYïi€H6ÖÑiámø^ÈY´°Ñ7¥Û*—Ñ©L«Qƒï—Ùrÿ ›£Ð*š¸ˆL©ˆ$ˆ ÷¾D§9È®«qbqC)–ˆïv´çñsÑVT­Ø, <àïºÀO«Jý·õ àfPìð .wFšir´þ’2_Y *Æ€x\« ì€9š@ Ž|F⇥ˆkZ@hÖÄ0t¿-<“‹qµ¾*ZL¤Ú)&BJpÓF5=$„at*Zš$’ÑtdûÝRI1 2މ$€$I$#‰SÞ’Hë¬ï;Á$¡t$’`<(ñÇt)$‡Ð.Êf¢X’Kt=Éé$‚ˆªè¢oÝëòI%Rgcª÷ŠyI%¡‰ÿ !ñ)´õ $¤ Ô’IIGÿÙa 3gW@sLdZddlZddlZddlZddlZddlZddlZddlZddlZz ddl Z Wne yfdZ Yn0z ddl Z Wne ydZ Yn0ddl m Z mZddlmZmZddlmZddlmZmZmZddlmZddlmZdd lmZGd d d ZGd d d ZGdddeejZGdddZ GdddeejZ!GdddZ"GdddejZ#Gddde#Z$Gddde#Z%Gddde#Z&Gddde#Z'Gd d!d!e#Z(Gd"d#d#e#Z)Gd$d%d%e#Z*Gd&d'd'e#Z+Gd(d)d)e#Z,Gd*d+d+Z-Gd,d-d-ejZ.Gd.d/d/ejZ/Gd0d1d1ejZ0e1d2krHe2dS)3z, Tests for fileinput module. Nick Mathewson N)BytesIOStringIO) FileInput hook_encoded)Path)verboseTESTFNcheck_warnings)unlink)support)mockc@seZdZddddZdS) BaseTestswmodecCsRt\}}|tj|t||}||Wdn1sD0Y|SN)tempfilemkstemp addCleanupr r openwrite)selfZcontentrfdnamefr2/opt/python39/lib/python3.9/test/test_fileinput.pywriteTmp(s   (zBaseTests.writeTmpN)__name__ __module__ __qualname__rrrrrr %sr c@sDeZdZddZeddZddZddd Zdd d Zd dZ dS) LineReadercCs g|_dSr _linesreadrrrr__init__1szLineReader.__init__cCs$z|jddWg|_Sg|_0dSrr"r$rrr linesread4s zLineReader.linesreadcCst|d|_|SNT)iter splitlinesit)rfilenamerrrropenhook;szLineReader.openhookNcCst|jd}|j||S)N)nextr*r#append)rsizelinerrrreadline?s  zLineReader.readlinecCs@g}d}|}|s|S|||t|7}||kr|SqdSNr)r2r/len)rhintlinesr0r1rrr readlinesDs  zLineReader.readlinescCsdSrrr$rrrclosePszLineReader.close)N)r3) rrr r%propertyr&r,r2r8r9rrrrr!/s   r!c@seZdZddZdS)BufferSizesTestsc Cs|dddtdD}|dddtdD}|dddtdD}|dd dtd D}td }trtd t||||fd }t|}| | t |d| |dd| |dd| | d| | |trtdt||||fd }d}|r@|dkr@|}q$| | || | d| |d||||trtd|| |d| | d| trtdt||||dfd }tj} zTtdt_t|}| t |d| |dd | | d!|W| t_n| t_0tr^td"t||||fd }| | d#| | d|| | d#| | dtrtd$tj} zJt||||fd d%}|D]} | dd&} t| q| W| t_n| t_0t||||fd }|D]N} | | d&d'|| dd&} || d| t| d |q6| dS)(Nr-css|]}d|dVqdS)zLine %s of file 1 Nr.0irrr Vz5BufferSizesTests.test_buffer_sizes..css|]}d|dVqdS)zLine %s of file 2 r<Nrr=rrrr@WrA css|]}d|dVqdS)zLine %s of file 3 r<Nrr=rrrr@XrAcss|]}d|dVqdS)zLine %s of file 4 r<Nrr=rrrr@YrAr<zLINE (\d+) OF FILE (\d+)z1. Simple iterationfileszLine 5 of file 1 zLine 1 of file 4 z2. Status variablesxzLine 6 of file 2 z 3. NextfilezLine 1 of file 3 z4. Stdin-z Line 1 of stdin Line 2 of stdin ! zLine 2 of stdin zz5. Boundary conditionsrz 6. InplacerFinplacer3 )rjoinrangerecompilerprintrlistr9 assertEqualr5linenor+r2 filelineno assertFalse isfirstlineisstdinnextfilesysstdinrstdoutuppermatchassertNotEqualintgroup) rt1t2t3t4patfir7sZ savestdinZ savestdoutr1mrrrtest_buffer_sizesTs       z"BufferSizesTests.test_buffer_sizesN)rrr rqrrrrr;Ssr;c@seZdZddZddZdS)UnconditionallyRaisecCs||_d|_dSNF)exception_typeinvoked)rrtrrrr%szUnconditionallyRaise.__init__cOsd|_|dSr')rurtrargskwargsrrr__call__szUnconditionallyRaise.__call__Nrrr r%ryrrrrrrsrrc@seZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZejedddZddZejedd d!Zejedd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4S)5FileInputTestscCs|d}|d}|d}|d}t||||fd}|}||d||d||d||||}||||d||d||||dS)Nr-zThe only line there is. rEr<r) rrr2rZr[r\r+r]r9)rrirjrkrlrnr1rrrtest_zero_byte_filess       z#FileInputTests.test_zero_byte_filescCs^|d}|d}t||fd}t|}||gd||d||ddS)NA B CD E FrEA B CzD zE FrL)rrrYrZr\r[rrirjrnr7rrr%test_files_that_dont_end_with_newlines  z4FileInputTests.test_files_that_dont_end_with_newlinecCs~|d}|d}t||fd}||dt|}||d|||dt|}||ddS)NzA BzC DrEr3)rrrZfilenor.rfr`rY)rrirjrnr1rrr test_filenos  zFileInputTests.test_filenocCsztdd}|dWnty*Yn0|jddd}tdtft|dd}Wdn1sh0Ytdtft|}Wdn1s0Y||gd dS) Nrrz-FileInput should reject invalid mode argumentA B C Dwbr-UrFr)rrC D)rfail ValueErrorrr DeprecationWarningrYrZ)rrnrir7rrrtest_opening_modes  *&z FileInputTests.test_opening_modecCs\td>}td|_tdgdd}t|}||dgWdn1sN0YdS)Nz sys.stdinspam, bacon, sausage, and spamrNrbr)r ZpatchrbufferrrYrZ)rZm_stdinrnr7rrrtest_stdin_binary_modes   z%FileInputTests.test_stdin_binary_modecCs^tj}zJtdt_|ttjdtdgdd}t|}||dgW|t_n|t_0dS)NrrrNrr)rarbrr]hasattrrrYrZ)rZ orig_stdinrnr7rrrtest_detached_stdin_binary_modes z.FileInputTests.test_detached_stdin_binary_modecCsztdddd}|dWnty0Yn0ztdd}|dWnty\Yn0Gdd d }|d }|}t|g|d}|Wdn1s0Y||jd dS) Nr<cSsdSrr)rrprrrrAz7FileInputTests.test_file_opening_hook..)rRr,zGFileInput should raise if both inplace and openhook arguments are given)r,z2FileInput should check openhook for being callablec@seZdZddZddZdS)z=FileInputTests.test_file_opening_hook..CustomOpenHookcSs d|_dSrs)rur$rrrr%szFFileInputTests.test_file_opening_hook..CustomOpenHook.__init__cWsd|_t|Sr')rur)rrwrrrryszFFileInputTests.test_file_opening_hook..CustomOpenHook.__call__NrzrrrrCustomOpenHooksrrSzopenhook not invoked)rrrrr2 assertTrueru)rrnrtZcustom_open_hookrrrtest_file_opening_hooks     &z%FileInputTests.test_file_opening_hookc Cs2ttd2}|d|dd|dWdn1sB0Y|tttttdd}z4||d||d ||d Wnt y| d Yn0| t t |Wdn1s0Y||d ||d Wdn1s$0YdS) NrsA B C s 123456789 iasciirFr,rrrzRead to end of filer-) rrrr safe_unlinkrrrZr2UnicodeDecodeErrorr assertRaisesrYrrrnrrr test_readline s&  (   &zFileInputTests.test_readlinecCsttd}|dWdn1s*0Y|ttttdd`}||d||d||d||d||dWdn1s0YdS) NrrrrsA sB sC DrA)rrrrrrrZr2rrrrtest_readline_binary_mode7s ( z(FileInputTests.test_readline_binary_modecCs|jddd}t|ddd0}|}||dtjdWdn1sR0Yt|d }||dWdn1s0YdS)Ns Initial text.rrrT)rrRs New line.) rrr2rZrarcrrread)rZ temp_fileZfobjr1rrrrtest_inplace_binary_write_modeDs * z-FileInputTests.test_inplace_binary_write_modecCs|d}|d}t||fd}t|}Wdn1s@0Y||gd||d||d||jddS)Nr}r~rErrrLr)rrrYrZr\r[_filesrrrrtest_context_managerNs  &z#FileInputTests.test_context_managercCsb|d}z2t|d}tWdn1s00YWn ty\||jdYn0dS)Nr-rEr)rrOSErrorrZr)rrirnrrrtest_close_on_exceptionXs   & z&FileInputTests.test_close_on_exceptioncCs<tgd}||jdWdn1s.0YdS)NrE)rN)rrZr)rrnrrr.test_empty_files_list_specified_to_constructor`s z=FileInputTests.test_empty_files_list_specified_to_constructor)categorycCsb|d}t|gd8}|d}||d|d}||dWdn1sT0YdS)zNTests invoking FileInput.__getitem__() with the current line number line1 line2 rErline1 r<zline2 N)rrrZ)rrrnZretval1Zretval2rrrtest__getitem__ds   zFileInputTests.test__getitem__c Csv|d}|tdLt|gd }||ddWdn1sJ0YWdn1sh0YdS)NrzUse iterator protocol insteadrErr)rZassertWarnsRegexrrrZ)rrrnrrrtest__getitem___deprecationos  z*FileInputTests.test__getitem___deprecationc Cs||d}t|gdB}|t}|dWdn1s@0YWdn1s^0Y||jjddS)zZTests invoking FileInput.__getitem__() with an index unequal to the line numberrrEr<N)zaccessing lines out of order)rrr RuntimeErrorrZ exceptionrwrrrncmrrrtest__getitem__invalid_keyvs   Dz)FileInputTests.test__getitem__invalid_keyc Cs||d}t|gdB}|t}|dWdn1s@0YWdn1s^0Y||jjddS)zZTests invoking FileInput.__getitem__() with the line number but at end-of-inputr-rErN)zend of input reached)rrr IndexErrorrZrrwrrrrtest__getitem__eofs   Dz!FileInputTests.test__getitem__eofcCstj}tt}zj|d}|tj|dt|gdd&}t||t_| Wdn1sf0YW|t_n|t_0| |j ddS)zTests invoking FileInput.nextfile() when the attempt to delete the backup file would raise OSError. This error is expected to be silently ignoredrSz.bakTrQNzos.unlink() was not invoked) osr rrrrrr rr.r`rru)rZos_unlink_origZos_unlink_replacementrrnrrr%test_nextfile_oserror_deleting_backups (z4FileInputTests.test_nextfile_oserror_deleting_backupcCsztj}tt}zP|d}t|gdd}|t_|Wdn1sL0YW|t_n|t_0||jddS)z{Tests invoking FileInput.readline() when os.fstat() raises OSError. This exception should be silently discarded.rSTrQNos.fstat() was not invoked) rfstatrrrrrr2rru)rZ os_fstat_origZos_fstat_replacementrrnrrr%test_readline_os_fstat_raises_OSErrors (z4FileInputTests.test_readline_os_fstat_raises_OSErrorcCsztj}tt}zP|d}t|gdd}|t_|Wdn1sL0YW|t_n|t_0||jddS)z{Tests invoking FileInput.readline() when os.chmod() raises OSError. This exception should be silently discarded.rSTrQNr) rchmodrrrrrr2rru)rZ os_chmod_origZos_chmod_replacementrrnrrr%test_readline_os_chmod_raises_OSErrors (z4FileInputTests.test_readline_os_chmod_raises_OSErrorc CsGdddt}|}|d}t|gd8}|j}z||_|}W||_n||_0Wdn1sj0Y||jd||dddS)Nc@seZdZddZddZdS)zQFileInputTests.test_fileno_when_ValueError_raised..FilenoRaisesValueErrorcSst|tdSr)rrr%rr$rrrr%szZFileInputTests.test_fileno_when_ValueError_raised..FilenoRaisesValueError.__init__cSs |dSr)ryr$rrrrszXFileInputTests.test_fileno_when_ValueError_raised..FilenoRaisesValueError.filenoN)rrr r%rrrrrFilenoRaisesValueErrorsrrSrEz_file.fileno() was not invokedr3zfileno() should return -1)rrrr_filerrrurZ)rrZ unconditionally_raise_ValueErrorrrnZ file_backupresultrrr"test_fileno_when_ValueError_raiseds  .z1FileInputTests.test_fileno_when_ValueError_raisedcCst}tddg|jd}||jg||d||jdg||d||jdg||d||jddg||d||jdg||d||jgWdn1s0YdSNz line1 line2zline3 rrZline2r-)r!rr,rZr&r2rsrcrnrrrtest_readline_bufferings z&FileInputTests.test_readline_bufferingcCst}tddg|jd}||jg|t|d||jdg|t|d||jdg|t|d||jddg|tt|||jdg|tt|||jgWdn1s0YdSr)r!rr,rZr&r.r StopIterationrrrrtest_iteration_bufferings z'FileInputTests.test_iteration_bufferingcCst|d}t|Z}|}||d||d||d||t |Wdn1sv0YdS)N Pathlib file.r<) rrrr2rZr[r\r+rfspath)rrirnr1rrrtest_pathlib_files  z FileInputTests.test_pathlib_filecCst|d}t|dd0}|}||dtd|Wdn1sP0Yt| }||dWdn1s0YdS)NrT)rRz Modified %szModified Pathlib file. )rrrr2rZrXrr)rrirnr1rrrrtest_pathlib_file_inplaces * z(FileInputTests.test_pathlib_file_inplaceN)rrr r|rrrrrrrrrrrrr Zignore_warningsrrrrrrrrrrrrrrrrrr{s8           r{c@sbeZdZdZddddddZd d Zd d Zd dZddZddZ ddZ ddZ ddZ dS) MockFileInputzDA class that mocks out fileinput.FileInput for use during unit testsNFr-r)rr,cCs>||_||_||_||_||_d|_tdd|_i|_ dS)NcSsdSr4rrrrrrrAz(MockFileInput.__init__..) rFrRbackuprr,r collections defaultdictinvocation_counts return_values)rrFrRrrr,rrrr%szMockFileInput.__init__cCs|jdd7<dS)Nr9r<)rr$rrrr9szMockFileInput.closecCs|jdd7<|jdS)Nr`r<rrr$rrrr`szMockFileInput.nextfilecCs|jdd7<|jdS)Nr+r<rr$rrrr+"szMockFileInput.filenamecCs|jdd7<|jdS)Nr[r<rr$rrrr[&szMockFileInput.linenocCs|jdd7<|jdS)Nr\r<rr$rrrr\*szMockFileInput.filelinenocCs|jdd7<|jdS)Nrr<rr$rrrr.szMockFileInput.filenocCs|jdd7<|jdS)Nr^r<rr$rrrr^2szMockFileInput.isfirstlinecCs|jdd7<|jdS)Nr_r<rr$rrrr_6szMockFileInput.isstdin)NFr-) rrr __doc__r%r9r`r+r[r\rr^r_rrrrr s rc@s(eZdZdZddZddZddZdS) BaseFileInputGlobalMethodsTestzQBase class for unit tests for the global function of the fileinput module.cCstj|_tj|_tt_dSr) fileinput_state _orig_stater_orig_FileInputrr$rrrsetUp>sz$BaseFileInputGlobalMethodsTest.setUpcCs|jt_|jt_dSr)rrrrrr$rrrtearDownCsz'BaseFileInputGlobalMethodsTest.tearDowncCs2|j|}||d|t|j}||ddSNr<)rrZr5)rZmock_file_inputZ method_nameZ actual_countZactual_total_countrrrassertExactlyOneInvocationGs  z9BaseFileInputGlobalMethodsTest.assertExactlyOneInvocationN)rrr rrrrrrrrr:src@s0eZdZdZddZddZddZdd Zd S) Test_fileinput_inputz Unit tests for fileinput.input()cCsjt}t|_|t_|t}tWdn1s<0Y|d|j j | |tjddS)zTests invoking fileinput.input() when fileinput._state is not None and its _file attribute is also not None. Expect RuntimeError to be raised with a meaningful error message and for fileinput._state to *not* be modified.N)zinput() already activefileinput._state) robjectrrrrrinputrZrrwassertIs)rinstancerrrr1test_state_is_not_None_and_state_file_is_not_NoneRs &zFTest_fileinput_input.test_state_is_not_None_and_state_file_is_not_NonecCst}d|_|t_|dS)a\Tests invoking fileinput.input() when fileinput._state is not None but its _file attribute *is* None. Expect it to create and return a new fileinput.FileInput object with all method parameters passed explicitly to the __init__() method; also ensure that fileinput._state is set to the returned instance.N)rrrrdo_test_call_inputrrrrr-test_state_is_not_None_and_state_file_is_None_szBTest_fileinput_input.test_state_is_not_None_and_state_file_is_NonecCsdt_|dS)a4Tests invoking fileinput.input() when fileinput._state is None Expect it to create and return a new fileinput.FileInput object with all method parameters passed explicitly to the __init__() method; also ensure that fileinput._state is set to the returned instance.N)rrrr$rrrtest_state_is_Nonejsz'Test_fileinput_input.test_state_is_NonecCst}t}t}t}t}tj|||||d}||tjd|||jd|||jd|||jd|||jd|||j ddS) aTests that fileinput.input() creates a new fileinput.FileInput object, passing the given parameters unmodified to fileinput.FileInput.__init__(). Note that this test depends on the monkey patching of fileinput.FileInput done by setUp().)rFrRrrr,rrFrRrrr,N) rrrrrrFrRrrr,)rrFrRrrr,rrrrrss z'Test_fileinput_input.do_test_call_inputN)rrr rrrrrrrrrrOs    rc@s eZdZdZddZddZdS)Test_fileinput_closez Unit tests for fileinput.close()cCsdt_t|tjdS)zPTests that fileinput.close() does nothing if fileinput._state is NoneN)rrr9 assertIsNoner$rrrrsz'Test_fileinput_close.test_state_is_NonecCs0t}|t_t||d|tjdS)z`Tests that fileinput.close() invokes close() on fileinput._state and sets _state=Noner9N)rrrr9rrrrrrtest_state_is_not_Nones  z+Test_fileinput_close.test_state_is_not_NoneNrrr rrrrrrrrsrc@s eZdZdZddZddZdS)Test_fileinput_nextfilez#Unit tests for fileinput.nextfile()cCsXdt_|t}tWdn1s.0Y|d|jj|tjdS)zTests fileinput.nextfile() when fileinput._state is None. Ensure that it raises RuntimeError with a meaningful error message and does not modify fileinput._stateNzno active input()) rrrrr`rZrrwrrrrrrrs  &z*Test_fileinput_nextfile.test_state_is_NonecCsNt}t}||jd<|t_t}||d||||tj|dS)aTests fileinput.nextfile() when fileinput._state is not None. Ensure that it invokes fileinput._state.nextfile() exactly once, returns whatever it returns, and does not modify fileinput._state to point to a different object.r`N)rrrrrr`rr)rZnextfile_retvalrretvalrrrrs   z.Test_fileinput_nextfile.test_state_is_not_NoneNrrrrrrs rc@s eZdZdZddZddZdS)Test_fileinput_filenamez#Unit tests for fileinput.filename()cCsXdt_|t}tWdn1s.0Y|d|jj|tjdS)zTests fileinput.filename() when fileinput._state is None. Ensure that it raises RuntimeError with a meaningful error message and does not modify fileinput._stateNr) rrrrr+rZrrwrrrrrrs  &z*Test_fileinput_filename.test_state_is_NonecCsNt}t}||jd<|t_t}||d||||tj|dS)aTests fileinput.filename() when fileinput._state is not None. Ensure that it invokes fileinput._state.filename() exactly once, returns whatever it returns, and does not modify fileinput._state to point to a different object.r+N)rrrrrr+rr)rZfilename_retvalrrrrrrs   z.Test_fileinput_filename.test_state_is_not_NoneNrrrrrrs rc@s eZdZdZddZddZdS)Test_fileinput_linenoz!Unit tests for fileinput.lineno()cCsXdt_|t}tWdn1s.0Y|d|jj|tjdS)zTests fileinput.lineno() when fileinput._state is None. Ensure that it raises RuntimeError with a meaningful error message and does not modify fileinput._stateNr) rrrrr[rZrrwrrrrrrs  &z(Test_fileinput_lineno.test_state_is_NonecCsNt}t}||jd<|t_t}||d||||tj|dS)zTests fileinput.lineno() when fileinput._state is not None. Ensure that it invokes fileinput._state.lineno() exactly once, returns whatever it returns, and does not modify fileinput._state to point to a different object.r[N)rrrrrr[rr)rZ lineno_retvalrrrrrrs   z,Test_fileinput_lineno.test_state_is_not_NoneNrrrrrrs rc@s eZdZdZddZddZdS)Test_fileinput_filelinenoz%Unit tests for fileinput.filelineno()cCsXdt_|t}tWdn1s.0Y|d|jj|tjdS)zTests fileinput.filelineno() when fileinput._state is None. Ensure that it raises RuntimeError with a meaningful error message and does not modify fileinput._stateNr) rrrrr\rZrrwrrrrrrs  &z,Test_fileinput_filelineno.test_state_is_NonecCsNt}t}||jd<|t_t}||d||||tj|dS)aTests fileinput.filelineno() when fileinput._state is not None. Ensure that it invokes fileinput._state.filelineno() exactly once, returns whatever it returns, and does not modify fileinput._state to point to a different object.r\N)rrrrrr\rr)rZfilelineno_retvalrrrrrrs   z0Test_fileinput_filelineno.test_state_is_not_NoneNrrrrrrs rc@s eZdZdZddZddZdS)Test_fileinput_filenoz!Unit tests for fileinput.fileno()cCsXdt_|t}tWdn1s.0Y|d|jj|tjdS)zTests fileinput.fileno() when fileinput._state is None. Ensure that it raises RuntimeError with a meaningful error message and does not modify fileinput._stateNr) rrrrrrZrrwrrrrrrs  &z(Test_fileinput_fileno.test_state_is_NonecCsTt}t}||jd<||_|t_t}||d||||tj|dS)zTests fileinput.fileno() when fileinput._state is not None. Ensure that it invokes fileinput._state.fileno() exactly once, returns whatever it returns, and does not modify fileinput._state to point to a different object.rN) rrr fileno_retvalrrrrr)rrrrrrrrs   z,Test_fileinput_fileno.test_state_is_not_NoneNrrrrrr s rc@s eZdZdZddZddZdS)Test_fileinput_isfirstlinez&Unit tests for fileinput.isfirstline()cCsXdt_|t}tWdn1s.0Y|d|jj|tjdS)zTests fileinput.isfirstline() when fileinput._state is None. Ensure that it raises RuntimeError with a meaningful error message and does not modify fileinput._stateNr) rrrrr^rZrrwrrrrrr+s  &z-Test_fileinput_isfirstline.test_state_is_NonecCsNt}t}||jd<|t_t}||d||||tj|dS)aTests fileinput.isfirstline() when fileinput._state is not None. Ensure that it invokes fileinput._state.isfirstline() exactly once, returns whatever it returns, and does not modify fileinput._state to point to a different object.r^N)rrrrrr^rr)rZisfirstline_retvalrrrrrr5s   z1Test_fileinput_isfirstline.test_state_is_not_NoneNrrrrrr(s rc@s eZdZdZddZddZdS)Test_fileinput_isstdinz"Unit tests for fileinput.isstdin()cCsXdt_|t}tWdn1s.0Y|d|jj|tjdS)zTests fileinput.isstdin() when fileinput._state is None. Ensure that it raises RuntimeError with a meaningful error message and does not modify fileinput._stateNr) rrrrr_rZrrwrrrrrrFs  &z)Test_fileinput_isstdin.test_state_is_NonecCsNt}t}||jd<|t_t}||d||||tj|dS)zTests fileinput.isstdin() when fileinput._state is not None. Ensure that it invokes fileinput._state.isstdin() exactly once, returns whatever it returns, and does not modify fileinput._state to point to a different object.r_N)rrrrrr_rr)rZisstdin_retvalrrrrrrPs   z-Test_fileinput_isstdin.test_state_is_not_NoneNrrrrrrCs rc@seZdZddZddZdS)InvocationRecordercCs d|_dSr4)invocation_countr$rrrr%_szInvocationRecorder.__init__cOs|jd7_||f|_dSr)rlast_invocationrvrrrryaszInvocationRecorder.__call__Nrzrrrrr^src@s|eZdZdZddZddZddZee dd d Z ee d d d Z ddZ ddZddZddZeddZdS)Test_hook_compressedz*Unit tests for fileinput.hook_compressed()cCs t|_dSr)r fake_openr$rrrrhszTest_hook_compressed.setUpcCs|dddS)Nr-r<do_test_use_builtin_openr$rrrtest_empty_stringksz&Test_hook_compressed.test_empty_stringcCs|dddS)NZabcdrr$rrr test_no_extnsz Test_hook_compressed.test_no_extzRequires gzip and zlibcCsVtj}|jt_ztdd}W|t_n|t_0||jjd||jjdifdS)Ntest.gzrr<)rr)gziprrrhook_compressedrZrrr original_openrrrrtest_gz_ext_fakeqsz%Test_hook_compressed.test_gz_ext_fakez Requires bz2cCsVtj}|jt_ztdd}W|t_n|t_0||jjd||jjdifdS)Ntest.bz2rHr<)r rH)bz2BZ2FilerrrrZrrrrrrtest_bz2_ext_fake}sz&Test_hook_compressed.test_bz2_ext_fakecCs|dddS)Nz abcd.blahrDrr$rrr test_blah_extsz"Test_hook_compressed.test_blah_extcCs|dddS)Nzabcd.GzrLrr$rrrtest_gz_ext_builtinsz(Test_hook_compressed.test_gz_ext_builtincCs|dddS)Nzabcd.Bz2rr$rrrtest_bz2_ext_builtinsz)Test_hook_compressed.test_bz2_ext_builtinc Cs`||j}zt||}W||n ||0||jjd||jj||fifdSr)replace_builtin_openrrrrZrr)rr+rr rrrrrs   z-Test_hook_compressed.do_test_use_builtin_opencCstj}|t_|Sr)builtinsr)Z new_open_funcr rrrrsz)Test_hook_compressed.replace_builtin_openN)rrr rrrrunittestZ skipUnlessrr r rrrrr staticmethodrrrrrres    rc@s(eZdZdZddZddZddZdS) Test_hook_encodedz'Unit tests for fileinput.hook_encoded()c Cst}t}tj||d}t}tj}|t_z t}t}|||}W|t_n|t_0||jd|j\} } | | d|| | d|| | d|| | d|| | dS)Nerrorsr<rencodingr) rrrrrrrZrrrpopr]) rrrrrr r+rZ open_resultrwrxrrrtests$  zTest_hook_encoded.testcsttd}|dWdn1s*0Yttfdd}|ddgt|ddgWdn1s0Y|dd g|d d gdS) NrsabccsNttdtd|dd}t|}Wdn1s40Y||dS)Nrzutf-8rrFrr,rrrrYrZ)rexpected_linesrnr7r$rrchecks  &z,Test_hook_encoded.test_errors..checkignoreabcstrictreplaceu�abcbackslashreplacez\x80abc)rrrrrrrrrr rr$r test_errorss (    * zTest_hook_encoded.test_errorscsttd}|dWdn1s*0Yttfdd}|dgdt|dgdWdn1s0Yt|dgdWdn1s0Yt|d gd Wdn1s0YdS) Nrs A B C D+IKw-csJtt|tdd}t|}Wdn1s00Y||dS)Nzutf-7rr)rrrnr7r$rrr s &z+Test_hook_encoded.test_modes..checkr)rrrD€ZrUrr)rzB zC r() rrrrrZ assertWarnsrrrr&rr$r test_modess (   , , zTest_hook_encoded.test_modesN)rrr rrr'r)rrrrrsrc@seZdZddZdS)MiscTestcCst|tdSr)r Z check__all__rr$rrrtest_allszMiscTest.test_allN)rrr r+rrrrr*sr*__main__)3rrrarVrrrrrr  ImportErrorriorrrrpathlibrZ test.supportrrr r rrr r r r!ZTestCaser;rrr{rrrrrrrrrrrrrrr*rmainrrrrs^           $Sa->>A