ó
ŠwÛjc           @   sv  d  d l  m Z d  d l m Z m Z m Z m Z m Z d  d l	 Z	 d  d l
 m Z d  d l Z d  d l Z d  d l Z y d  d l Z Wn e k
 r¡ e Z n Xe d ƒ Z d  d l m Z m Z m Z e j d d d	 f k Z d
 e	 j f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d „  Z e d k rre ƒ  n  d S(   iÿÿÿÿ(   t   test_support(   t   TESTFNt   _4Gt
   bigmemtestt   import_modulet   findfileN(   t   StringIOt   bz2(   t   BZ2Filet   BZ2Compressort   BZ2Decompressort   win32t   os2emxt   riscost   BaseTestc           B   sA   e  Z d  Z d Z d Z d Z d Z e r6 d „  Z n	 d „  Z RS(   s   Base for other testcases.s  root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:
daemon:x:2:2:daemon:/sbin:
adm:x:3:4:adm:/var/adm:
lp:x:4:7:lp:/var/spool/lpd:
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:
news:x:9:13:news:/var/spool/news:
uucp:x:10:14:uucp:/var/spool/uucp:
operator:x:11:0:operator:/root:
games:x:12:100:games:/usr/games:
gopher:x:13:30:gopher:/usr/lib/gopher-data:
ftp:x:14:50:FTP User:/var/ftp:/bin/bash
nobody:x:65534:65534:Nobody:/home:
postfix:x:100:101:postfix:/var/spool/postfix:
niemeyer:x:500:500::/home/niemeyer:/bin/bash
postgres:x:101:102:PostgreSQL Server:/var/lib/pgsql:/bin/bash
mysql:x:102:103:MySQL server:/var/lib/mysql:/bin/bash
www:x:103:104::/var/www:/bin/false
s�  BZh91AY&SY.ÈN >_€ @ÿðn ?çÿà0™ª ÀF†Œ#&ƒFš¦Ð¦“MQ§¨€4hh$¤i4ñ4SÒ<QµHÓÔÝÕ‡»ø”�¯IáÉø/E pu‰]É»DL
Q	1ß À—¬2O9‰”7d•IªJ¤L#œ¯º¼/—Š#CÈáŒWùâÐÖM§‹Xa<e„tËL³§ÙÍÑË„.¯³««­`n} lh	E,ŽZVH>ˆåÍ9gd6
é›ÕŠ™÷.KŽvû÷xw»ß¡’ñÝ|/";¢ºŸÕ±#A¶ö³oÉÅy\ëOç…š¼¶f8•2Õ×"%‰>V,÷¦zâŸ£ß"ÖE)I©^ÊórÐU’2ò6ì¶í‹ÃU�Å0¤ú^’¬DFŠ—ÖþÝ¸½š£€ankR‹åØ3]©Æ‚fö¹"6l$¸j@ÀŠ°l1..ºkƒls¼ôÁ¾øE¸�¨�k„Ónú¬Q±%yªv´àzõéÌ¹zn7.Gü]ÉáB@»!8`s¦  BZh91AY&SY®z»N Hß€ @ÿðn ?çÿà@¼Æ`†*�=M©š†ÐL@I¦!¡Èˆjdi�@@ƒ  Äh2‚D„e	è™‰h ¯›Gõ(?	Ïµü•E ps‰^¤Ý¢&(‡˜‰uä0%¶'ŒÄ‰Ê!‘UIFU%C™4!DIÒúðñN8WÞAõœr%?Ÿ3;I45AÑ‹T±<lºË_À0xYrˆ@ y@$)`òÎ‰z°sì›.iW��µ-+tŸ'—dBõxµ¾.[.×�çN`ˆÊ‡Ã!"€’R¡/ÑÀæmf¬½™Ìa³‡80>¤Ç�\"­¡«yBg¹lˆˆ‘k"”¤Ô‰®*¦ÖÔmè6ìµjŠ†j';Ê.IòªJèˆŒU+t3û
£3r2à³(¿ƒrçMðD65ØˆÓ¤’Ë2\Á°ê//¾k&Øæ+tå¡­aÞr5"w]¢i·[—R âITÍ;Zdk4­Š	Ó�zñ:^`«ÅÜ‘N$+ž®Ó€s   BZh9rE8P�    c      
   C   s‘   t  j d d t d t  j d t  j d t  j ƒ} | j j | ƒ | j j ƒ  | j j	 ƒ  } | j j ƒ  | j
 ƒ  d k r� t j | ƒ } n  | S(   Nt   bunzip2t   shellt   stdint   stdoutt   stderri    (   t
   subprocesst   Popent   Truet   PIPEt   STDOUTR   t   writet   closeR   t   readt   waitR   t
   decompress(   t   selft   datat   popt   ret(    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyR      s    		c         C   s   t  j | ƒ S(   N(   R   R   (   R   R   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyR   +   s    (	   t   __name__t
   __module__t   __doc__t   TEXTt   DATAt	   DATA_CRLFt
   EMPTY_DATAt   has_cmdline_bunzip2R   (    (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyR      s   t   BZ2FileTestc           B   s^  e  Z d  Z d „  Z d „  Z d d „ Z d „  Z d „  Z d „  Z d „  Z	 d	 „  Z
 d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e  j! e" d ƒ d  „  ƒ Z# d! „  Z$ e  j% e& j' d" k d# ƒ d$ „  ƒ Z( RS(%   s(   Test BZ2File type miscellaneous methods.c         C   s   t  |  _ d  S(   N(   R   t   filename(   R   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   setUp2   s    c         C   s,   t  j j |  j ƒ r( t  j |  j ƒ n  d  S(   N(   t   ost   patht   isfileR+   t   unlink(   R   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   tearDown5   s    i    c         C   sG   t  |  j d ƒ �/ } | r' |  j } n	 |  j } | j | ƒ Wd  QXd  S(   Nt   wb(   t   openR+   R'   R&   R   (   R   t   crlft   fR   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   createTempFile9   s
    	c         C   sU   |  j  ƒ  t |  j ƒ �6 } |  j t | j d  ƒ |  j | j ƒ  |  j ƒ Wd  QXd  S(   N(	   R6   R   R+   t   assertRaisest	   TypeErrorR   t   Nonet   assertEqualR%   (   R   t   bz2f(    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testReadA   s    
c         C   sU   |  j  ƒ  t |  j ƒ �6 } |  j t | j d  ƒ |  j | j d ƒ d ƒ Wd  QXd  S(   Ni    t    (   R6   R   R+   R7   R8   R   R9   R:   (   R   R;   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt	   testRead0H   s    
c         C   si   |  j  ƒ  t |  j ƒ �J } d } x' | j d ƒ } | s> Pn  | | 7} q% W|  j | |  j ƒ Wd  QXd  S(   NR=   i
   (   R6   R   R+   R   R:   R%   (   R   R;   t   textt   str(    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testReadChunk10O   s    
c         C   sF   |  j  ƒ  t |  j ƒ �' } |  j | j d ƒ |  j d  ƒ Wd  QXd  S(   Nid   (   R6   R   R+   R:   R   R%   (   R   R;   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testRead100[   s    
c         C   sx   |  j  ƒ  t |  j ƒ �Y } |  j t | j d  ƒ t |  j ƒ } x* | j	 ƒ  D] } |  j
 | j ƒ  | ƒ qN WWd  QXd  S(   N(   R6   R   R+   R7   R8   t   readlineR9   R   R%   t	   readlinesR:   (   R   R;   t   siot   line(    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testReadLinea   s    
c         C   sg   |  j  ƒ  t |  j ƒ �H } |  j t | j d  ƒ t |  j ƒ } |  j	 | j ƒ  | j ƒ  ƒ Wd  QXd  S(   N(
   R6   R   R+   R7   R8   RD   R9   R   R%   R:   (   R   R;   RE   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testReadLinesj   s
    
c         C   sW   |  j  ƒ  t |  j ƒ �8 } t |  j ƒ } |  j t t | ƒ ƒ | j ƒ  ƒ Wd  QXd  S(   N(	   R6   R   R+   R   R%   R:   t   listt   iterRD   (   R   R;   RE   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testIteratorr   s    
c         C   sM   |  j  ƒ  t |  j ƒ } | j ƒ  |  j t | j ƒ |  j t | j ƒ d  S(   N(   R6   R   R+   R   R7   t
   ValueErrort   nextRD   (   R   R;   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testClosedIteratorDeadlocky   s
    

c         C   sX   |  j  ƒ  t |  j ƒ } t |  j ƒ } |  j t | j ƒ  ƒ | j ƒ  ƒ | j	 ƒ  d  S(   N(
   R6   R   R+   R   R%   R:   RI   t
   xreadlinesRD   R   (   R   R;   RE   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testXReadLines„   s
    
"c         C   sV   |  j  ƒ  t |  j d ƒ } |  j | j ƒ  |  j ƒ |  j | j d ƒ | j ƒ  d  S(   Nt   rUs   
(   R6   R   R+   R:   R   R%   t   newlinesR   (   R   R;   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testUniversalNewlinesLFŒ   s
    
c         C   s\   |  j  d d ƒ t |  j d ƒ } |  j | j ƒ  |  j ƒ |  j | j d ƒ | j ƒ  d  S(   NR4   i   RQ   s   
(   R6   R   R+   R:   R   R%   RR   R   (   R   R;   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testUniversalNewlinesCRLF”   s
    c         C   s   t  |  j d ƒ �* } |  j t | j ƒ | j |  j ƒ Wd  QXt |  j d ƒ �) } |  j |  j | j	 ƒ  ƒ |  j ƒ Wd  QXd  S(   Nt   wt   rb(
   R   R+   R7   R8   R   R%   R3   R:   R   R   (   R   R;   R5   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt	   testWriteœ   s
    c         C   s¦   t  |  j d ƒ �Q } d } xA |  j | d | d d !} | sD Pn  | j | ƒ | d 7} q WWd  QXt |  j d ƒ �) } |  j |  j | j ƒ  ƒ |  j ƒ Wd  QXd  S(   NRU   i    i
   i   RV   (   R   R+   R%   R   R3   R:   R   R   (   R   R;   t   nR@   R5   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testWriteChunks10¤   s    c         C   sª   t  |  j d ƒ �< } |  j t | j ƒ t |  j ƒ } | j | j ƒ  ƒ Wd  QX|  j t | j d g ƒ t	 |  j d ƒ �) } |  j
 |  j | j ƒ  ƒ |  j ƒ Wd  QXd  S(   NRU   t   aRV   (   R   R+   R7   R8   t
   writelinesR   R%   RD   RL   R3   R:   R   R   (   R   R;   RE   R5   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testWriteLines±   s    c      	   C   sv   t  |  j d ƒ � } | j d ƒ Wd  QXt  |  j d ƒ �6 } |  j t | j d ƒ |  j t | j d g ƒ Wd  QXd  S(   NRU   t   abct   rRZ   (   R   R+   R   R7   t   IOErrorR[   (   R   R;   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testWriteMethodsOnReadOnlyFile¼   s
    c         C   sc   |  j  ƒ  t |  j ƒ �D } |  j t | j ƒ | j d ƒ |  j | j ƒ  |  j d ƒ Wd  QXd  S(   Ni–   (	   R6   R   R+   R7   R8   t   seekR:   R   R%   (   R   R;   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testSeekForwardÄ   s
    
c      	   C   s`   |  j  ƒ  t |  j ƒ �A } | j d ƒ | j d d ƒ |  j | j ƒ  |  j d ƒ Wd  QXd  S(   Niô  ijÿÿÿi   i–   i^  (   R6   R   R+   R   Ra   R:   R%   (   R   R;   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testSeekBackwardsÌ   s
    
c      	   C   s`   |  j  ƒ  t |  j ƒ �A } | j d d ƒ |  j | j ƒ  |  j t |  j ƒ d ƒ Wd  QXd  S(   Nijÿÿÿi   i–   (   R6   R   R+   Ra   R:   R   R%   t   len(   R   R;   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testSeekBackwardsFromEndÔ   s    
c         C   sh   |  j  ƒ  t |  j ƒ �I } | j d ƒ |  j | j ƒ  t |  j ƒ ƒ |  j | j ƒ  d ƒ Wd  QXd  S(   NiðI R=   (	   R6   R   R+   Ra   R:   t   tellRd   R%   R   (   R   R;   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testSeekPostEndÛ   s
    
c         C   su   |  j  ƒ  t |  j ƒ �V } | j d ƒ | j d ƒ |  j | j ƒ  t |  j ƒ ƒ |  j | j ƒ  d ƒ Wd  QXd  S(   NiðI R=   (	   R6   R   R+   Ra   R:   Rf   Rd   R%   R   (   R   R;   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testSeekPostEndTwiceã   s    
c         C   sb   |  j  ƒ  t |  j ƒ �C } | j d ƒ |  j | j ƒ  d ƒ |  j | j ƒ  |  j ƒ Wd  QXd  S(   Nijÿÿÿi    (   R6   R   R+   Ra   R:   Rf   R   R%   (   R   R;   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testSeekPreStartì   s
    
c         C   s7   |  j  ƒ  x& t d ƒ D] } t |  j ƒ } ~ q Wd  S(   Ni'  (   R6   t   xrangeR   R+   (   R   t   it   o(    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testOpenDelô   s    
c         C   s   |  j  t t d ƒ d  S(   Ns   /non/existent(   R7   R_   R   (   R   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testOpenNonexistentû   s    c         C   sr   |  j  ƒ  t |  j d ƒ } | j ƒ  t |  j ƒ } | j d d ƒ |  j | j ƒ  t |  j	 ƒ ƒ | j ƒ  d  S(   Nt   Ui    i   (
   R6   R   R+   R   t   fileRa   R:   Rf   Rd   R&   (   R   R;   R5   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt	   testModeUÿ   s    

c         C   s¦   d } t  |  j d ƒ � } | j | ƒ Wd  QXt |  j ƒ � } | j ƒ  } Wd  QX|  j | d g ƒ t |  j ƒ � } t | j ƒ  ƒ } Wd  QX|  j | d g ƒ d  S(   Ns,   BZh91AY&SYÙb‰]   €     !šh3M<]ÉáBCeŠ%tR2   t   Test(   R3   R+   R   R   RD   R:   RI   (   R   R   R5   R;   t   linest   xlines(    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testBug1191043	  s    c         C   sÈ   d  } t |  j d ƒ � } | j d ƒ Wd  QXt |  j d ƒ } | j ƒ  y | � Wd  QXWn t k
 rn n X|  j d ƒ y' t |  j d ƒ � } d d Wd  QXWn t k
 r¶ n X|  j d ƒ d  S(   NR2   t   xxxRV   s4   __enter__ on a closed file didn't raise an exceptioni   i    s    1 // 0 didn't raise an exception(   R9   R   R+   R   R   RL   t   failt   ZeroDivisionError(   R   R5   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testContextProtocol  s"    

s!   Threading required for this test.c      	      s…   d d ‰  d } t  j |  j d ƒ �Z ‰ ‡  ‡ f d †  } g  t | ƒ D] } t j d | ƒ ^ qG } t j | ƒ � Wd  QXWd  QXd  S(	   Nt   1i   i   i
   R2   c             s(   x! t  d ƒ D] }  ˆ j ˆ  ƒ q Wd  S(   Ni   (   t   rangeR   (   Rk   (   R   R5   (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   comp1  s    t   targeti   (   R   R   R+   R{   t	   threadingt   Threadt   supportt   start_threads(   R   t   nthreadsR|   Rk   t   threads(    (   R   R5   sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testThreading+  s    
+c         C   s—   t  j |  j d ƒ � } | j |  j d ƒ Wd  QXt  j |  j d ƒ �J } t | ƒ |  j t | j ƒ |  j t | j	 ƒ |  j t | j
 ƒ Wd  QXd  S(   NR2   id   RV   (   R   R   R+   R   R%   RM   R7   RL   R   RC   RD   (   R   R5   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testMixedIterationReads8  s    
R   sX   test depends on being able to delete a still-open file, which is not possible on Windowsc         C   sj   |  j  ƒ  t |  j d ƒ � } |  j t | j d ƒ Wd  QXt j |  j ƒ } |  j t | j d ƒ ~ d  S(   NR2   s   non-existent-file(   R6   R   R+   R7   R_   t   __init__R   (   R   R5   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testInitNonExistentFileE  s    
()   R"   R#   R$   R,   R1   R6   R<   R>   RA   RB   RG   RH   RK   RN   RP   RS   RT   RW   RY   R\   R`   Rb   Rc   Re   Rg   Rh   Ri   Rm   Rn   Rq   Ru   Ry   t   unittestt
   skipUnlessR~   R„   R…   t   skipIft   syst   platformR‡   (    (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyR*   /   sD   																												
			t   BZ2CompressorTestc           B   s>   e  Z d  „  Z d „  Z d „  Z e e d d ƒd „  ƒ Z RS(   c         C   s^   t  ƒ  } |  j t | j ƒ | j |  j ƒ } | | j ƒ  7} |  j |  j | ƒ |  j ƒ d  S(   N(   R	   R7   R8   t   compressR%   t   flushR:   R   (   R   t   bz2cR   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testCompressU  s
    	c         C   s?   t  ƒ  } | j d ƒ } | | j ƒ  7} |  j | |  j ƒ d  S(   NR=   (   R	   RŽ   R�   R:   R(   (   R   R�   R   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testCompressEmptyString]  s    	c         C   s�   t  ƒ  } d } d } xG |  j | d | d d !} | s> Pn  | | j | ƒ 7} | d 7} q W| | j ƒ  7} |  j |  j | ƒ |  j ƒ d  S(   Ni    R=   i
   i   (   R	   R%   RŽ   R�   R:   R   (   R   R�   RX   R   R@   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testCompressChunks10d  s    	t   memuseg      ô?c         C   st   d | } t  j ƒ  } | j | ƒ | j ƒ  } ~ |  j | ƒ } |  j t | ƒ | ƒ |  j | j d ƒ d ƒ d  S(   NRZ   R=   (   R   R	   RŽ   R�   R   R:   Rd   t   strip(   R   t   sizeR?   R�   R   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt
   testBigmemr  s    
(   R"   R#   R‘   R’   R“   R   R   R—   (    (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyR�   T  s   			t   BZ2DecompressorTestc           B   sP   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z e e d d ƒd „  ƒ Z	 RS(   c         C   s   |  j  t t d ƒ d  S(   Ni*   (   R7   R8   R
   (   R   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   test_Constructor~  s    c         C   sE   t  ƒ  } |  j t | j ƒ | j |  j ƒ } |  j | |  j ƒ d  S(   N(   R
   R7   R8   R   R&   R:   R%   (   R   t   bz2dR?   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testDecompress�  s    	c         C   sv   t  ƒ  } d } d } xG |  j | d | d d !} | s> Pn  | | j | ƒ 7} | d 7} q W|  j | |  j ƒ d  S(   NR=   i    i
   i   (   R
   R&   R   R:   R%   (   R   Rš   R?   RX   R@   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testDecompressChunks10ˆ  s    	c         C   sO   t  ƒ  } d } | j |  j | ƒ } |  j | |  j ƒ |  j | j | ƒ d  S(   Ns   this is unused data(   R
   R   R&   R:   R%   t   unused_data(   R   Rš   R�   R?   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testDecompressUnusedData•  s
    	c         C   sK   t  ƒ  } | j |  j ƒ } |  j t | j d ƒ |  j t | j d ƒ d  S(   Nt   anythingR=   (   R
   R   R&   R7   t   EOFError(   R   Rš   R?   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testEOFError�  s    	R”   g      ô?c         C   sw   | t  k  r |  j d ƒ n  t j d t  ƒ } t j ƒ  j | ƒ } |  j t | ƒ t  ƒ |  j | j d ƒ d ƒ d  S(   Ns    Test needs 5GB of memory to run.RZ   R=   (	   R   t   skipTestR   RŽ   R
   R   R:   Rd   R•   (   R   R–   t
   compressedR?   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyR—   ¤  s    (
   R"   R#   R™   R›   Rœ   Rž   R¡   R   R   R—   (    (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyR˜   }  s   					t   FuncTestc           B   sz   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e	 e
 d d ƒd	 „  ƒ Z e	 e
 d d ƒd
 „  ƒ Z RS(   s   Test module functionsc         C   s2   t  j |  j ƒ } |  j |  j | ƒ |  j ƒ d  S(   N(   R   RŽ   R%   R:   R   (   R   R   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyR‘   ²  s    c         C   s&   t  j d ƒ } |  j | |  j ƒ d  S(   NR=   (   R   RŽ   R:   R(   (   R   R?   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyR’   ·  s    c         C   s)   t  j |  j ƒ } |  j | |  j ƒ d  S(   N(   R   R   R&   R:   R%   (   R   R?   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyR›   ¼  s    c         C   s#   t  j d ƒ } |  j | d ƒ d  S(   NR=   (   R   R   R:   (   R   R?   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testDecompressEmptyÁ  s    c         C   s&   t  j |  j ƒ } |  j | d ƒ d  S(   NR=   (   R   R   R(   R:   (   R   R?   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testDecompressToEmptyStringÆ  s    c         C   s!   |  j  t t j |  j d  ƒ d  S(   Niöÿÿÿ(   R7   RL   R   R   R&   (   R   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testDecompressIncompleteË  s    R”   g      ô?c         C   s^   d | } t  j | ƒ } ~ |  j | ƒ } |  j t | ƒ | ƒ |  j | j d ƒ d ƒ d  S(   NRZ   R=   (   R   RŽ   R   R:   Rd   R•   (   R   R–   R?   R   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testCompressBigmemÏ  s    
c         C   sq   | t  k  r |  j d ƒ n  t j d t  ƒ } t j | ƒ } |  j t | ƒ t  ƒ |  j | j d ƒ d ƒ d  S(   Ns    Test needs 5GB of memory to run.RZ   R=   (   R   R¢   R   RŽ   R   R:   Rd   R•   (   R   R–   R£   R?   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   testDecompressBigmemØ  s    (   R"   R#   R$   R‘   R’   R›   R¥   R¦   R§   R   R   R¨   R©   (    (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyR¤   ¯  s   							c           C   s$   t  j t t t t ƒ t  j ƒ  d  S(   N(   R€   t   run_unittestR*   R�   R˜   R¤   t   reap_children(    (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt	   test_mainâ  s    t   __main__(    t   testR    R€   t   test.test_supportR   R   R   R   R   Rˆ   t	   cStringIOR   R-   R   R‹   R~   t   ImportErrorR9   R   R   R	   R
   RŒ   R)   t   TestCaseR   R*   R�   R˜   R¤   R¬   R"   (    (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_bz2.pyt   <module>   s,   (
ÿ &)23		