;
Íâ"Ic            	   @   sä   d  d l  Z  d  d l m Z d  d l Z d  d l Z d  d l Z Gd „  d e  j ƒ Z Gd „  d e  j ƒ Z Gd „  d e  j ƒ Z	 Gd	 „  d
 e  j ƒ Z
 d e d „ Z e e d „ Z d Z d „  Z e d k o e  j ƒ  n d S(   i    N(   u   supportc             B   sV   |  Ee  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d S(	   c             C   sB   |  j  t j d ƒ t j d d ƒ ƒ |  j t j d d ƒ ƒ d  S(   Ns    i    s   abcl   ÿÿ (   u   assertEqualu   zlibu   crc32u   assert_(   u   self(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_crc32start
   s    %c             C   sX   |  j  t j d d ƒ d ƒ |  j  t j d d ƒ d ƒ |  j  t j d d ƒ d ƒ d  S(   Ns    i    i   i°  (   u   assertEqualu   zlibu   crc32(   u   self(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_crc32empty   s    c             C   sB   |  j  t j d ƒ t j d d ƒ ƒ |  j t j d d ƒ ƒ d  S(   Ns    i   s   abcl   ÿÿ (   u   assertEqualu   zlibu   adler32u   assert_(   u   self(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_adler32start   s    %c             C   sX   |  j  t j d d ƒ d ƒ |  j  t j d d ƒ d ƒ |  j  t j d d ƒ d ƒ d  S(   Ns    i    i   i°  (   u   assertEqualu   zlibu   adler32(   u   self(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_adler32empty   s    c             C   s   |  j  | d @| d @ƒ d  S(   Nl   ÿÿ (   u   assertEqual(   u   selfu   seenu   expected(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   assertEqual32   s    c             C   s¾   |  j  t j d d ƒ d ƒ |  j  t j d d ƒ d ƒ |  j  t j d d ƒ d ƒ |  j  t j d d ƒ d ƒ |  j t j d ƒ t j d d ƒ ƒ |  j t j d ƒ t j d d ƒ ƒ d  S(   Ns   penguini    l    !ƒK i   i”ª¶CiöÏi÷Ö(   u   assertEqual32u   zlibu   crc32u   adler32u   assertEqual(   u   self(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_penguins!   s    %c             C   sr   d } |  j  t j | ƒ d ƒ |  j  t j d ƒ d ƒ |  j  t j | | ƒ d ƒ |  j  t j d ƒ d ƒ d  S(   Nu   abcdefghijklmnopl   “@u( u   spami=ÿÚCl    * i²O(   u   assertEqualu   zlibu   crc32u   adler32(   u   selfu   foo(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_crc32_adler32_unsigned*   s
    c             C   sd   d } d } |  j  t j | ƒ | ƒ |  j  t j | ƒ | ƒ |  j  t j d ƒ t j d ƒ ƒ d  S(   Nu   abcdefghijklmnopl   “@u( u   spam(   u   assertEqualu   binasciiu   crc32u   zlib(   u   selfu   foou   crc(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_same_as_binascii_crc322   s
    N(
   u   __name__u
   __module__u   test_crc32startu   test_crc32emptyu   test_adler32startu   test_adler32emptyu   assertEqual32u   test_penguinsu   test_crc32_adler32_unsignedu   test_same_as_binascii_crc32(   u
   __locals__(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   ChecksumTestCase   s   
								u   ChecksumTestCasec             B   s2   |  Ee  Z d  „  Z d „  Z d „  Z d „  Z d S(   c             C   s    |  j  t j t j d d ƒ d  S(   Nu   ERRORi
   (   u   assertRaisesu   zlibu   erroru   compress(   u   self(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_badlevel=   s    c             C   sI   |  j  t t j d t j d ƒ |  j  t t j d t j t j d ƒ d  S(   Ni   i    (   u   assertRaisesu
   ValueErroru   zlibu   compressobju   DEFLATEDu	   MAX_WBITS(   u   self(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_badcompressobjC   s    	c             C   s   |  j  t t j d ƒ d  S(   Ni    (   u   assertRaisesu
   ValueErroru   zlibu   decompressobj(   u   self(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_baddecompressobjJ   s    c             C   s<   |  j  t t j ƒ  j d ƒ |  j  t t j ƒ  j d ƒ d  S(   Ni    iÿÿÿÿ(   u   assertRaisesu
   ValueErroru   zlibu   decompressobju   flush(   u   self(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_decompressobj_badflushN   s    N(   u   __name__u
   __module__u   test_badlevelu   test_badcompressobju   test_baddecompressobju   test_decompressobj_badflush(   u
   __locals__(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   ExceptionTestCase;   s   
			u   ExceptionTestCasec             B   s    |  Ee  Z d  „  Z d „  Z d S(   c             C   s,   t  j t ƒ } |  j t  j | ƒ t ƒ d  S(   N(   u   zlibu   compressu   HAMLET_SCENEu   assertEqualu
   decompress(   u   selfu   x(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_speechW   s    c             C   s6   t  d } t j | ƒ } |  j t j | ƒ | ƒ d  S(   Ni€   (   u   HAMLET_SCENEu   zlibu   compressu   assertEqualu
   decompress(   u   selfu   datau   x(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_speech128[   s    
N(   u   __name__u
   __module__u   test_speechu   test_speech128(   u
   __locals__(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   CompressTestCaseU   s   
	u   CompressTestCasec             B   sê   |  Ee  Z d  „  Z d „  Z d „  Z d d d d d „ Z d „  Z d d d d „ Z	 d d „ Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z e e j ƒ  d ƒ o d „  Z d „  Z n e e j ƒ  d ƒ o d „  Z d „  Z n d S(   c             C   s¼   t  d } t j ƒ  } | j | ƒ } | j ƒ  } |  j t j | j ƒ t j ƒ  } | j | | ƒ } | j ƒ  } |  j	 | | | ƒ |  j
 t | j t ƒ ƒ |  j
 t | j t ƒ ƒ d  S(   Ni€   (   u   HAMLET_SCENEu   zlibu   compressobju   compressu   flushu   assertRaisesu   erroru   decompressobju
   decompressu   assertEqualu   assert_u
   isinstanceu   unconsumed_tailu   bytesu   unused_data(   u   selfu   datau   cou   x1u   x2u   dcou   y1u   y2(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu	   test_pairf   s    
c             C   s    d } t  j } d } d } t  j } t  j | | | | | ƒ } | j t ƒ } | j ƒ  } t  j | ƒ }	 |	 j | | ƒ }
 |	 j ƒ  } |  j	 t |
 | ƒ d  S(   Ni   iôÿÿÿi	   (
   u   zlibu   DEFLATEDu
   Z_FILTEREDu   compressobju   compressu   HAMLET_SCENEu   flushu   decompressobju
   decompressu   assertEqual(   u   selfu   levelu   methodu   wbitsu   memlevelu   strategyu   cou   x1u   x2u   dcou   y1u   y2(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_compressoptionst   s    		c       	      C   sÍ   t  d } t j ƒ  } g  } xD t d t | ƒ d ƒ D]* } | j | j | | | d … ƒ ƒ q5 W| j | j ƒ  ƒ d j | ƒ } t j	 ƒ  } | j
 d j | ƒ ƒ } | j ƒ  } |  j | | | ƒ d  S(   Ni€   i    i   s    (   u   HAMLET_SCENEu   zlibu   compressobju   rangeu   lenu   appendu   compressu   flushu   joinu   decompressobju
   decompressu   assertEqual(	   u   selfu   datau   cou   bufsu   iu   combufu   dcou   y1u   y2(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_compressincrementalƒ   s    
 (i   i@   c          
   C   sõ  | p t  } | d } t j ƒ  } g  } xD t d t | ƒ | ƒ D]* } | j | j | | | | … ƒ ƒ qB W| j | j ƒ  ƒ d j | ƒ }	 t j	 |	 ƒ }
 |  j
 t |
 t ƒ ƒ |  j | |
 ƒ t j ƒ  } g  } xz t d t |	 ƒ | ƒ D]` } | j | j	 |	 | | | … ƒ ƒ |  j d | j d t | j ƒ ƒ |  j d | j ƒ qò W| o | j | j ƒ  ƒ n/ x+ | j	 d ƒ } | o | j | ƒ qwPqw|  j d | j d t | j ƒ ƒ |  j d | j ƒ |  j | d j | ƒ ƒ d  S(   Ni€   i    s    u"   (A) uct should be b'': not %d longu    u"   (B) uct should be b'': not %d long(   u   HAMLET_SCENEu   zlibu   compressobju   rangeu   lenu   appendu   compressu   flushu   joinu
   decompressu   assert_u
   isinstanceu   bytesu   assertEqualu   decompressobju   unconsumed_tailu   unused_data(   u   selfu   flushu   sourceu   cxu   dcxu   datau   cou   bufsu   iu   combufu   decombufu   dcou   chunk(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_decompinc’   sB    
 ( $c             C   s   |  j  d d ƒ d  S(   Nu   flushT(   u   test_decompincu   True(   u   self(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_decompincflush»   s    c             C   s\  | p t  } | d } t j ƒ  } g  } xD t d t | ƒ | ƒ D]* } | j | j | | | | … ƒ ƒ qB W| j | j ƒ  ƒ d j | ƒ } |  j	 | t j
 | ƒ d ƒ t j ƒ  }	 g  } | }
 x` |
 oX |	 j
 |
 | ƒ } |  j t | ƒ | k d t | ƒ | f ƒ | j | ƒ |	 j }
 qÉ W| j |	 j ƒ  ƒ |  j	 | d j | ƒ d ƒ d  S(   Ni€   i    s    u   compressed data failureu   chunk too big (%d>%d)u   Wrong data retrieved(   u   HAMLET_SCENEu   zlibu   compressobju   rangeu   lenu   appendu   compressu   flushu   joinu   assertEqualu
   decompressu   decompressobju   failIfu   unconsumed_tail(   u   selfu   sourceu   cxu   dcxu   datau   cou   bufsu   iu   combufu   dcou   cbu   chunk(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_decompimax¾   s.    
 ( c             C   sÈ  t  d } t j ƒ  } g  } xD t d t | ƒ d ƒ D]* } | j | j | | | d … ƒ ƒ q5 W| j | j ƒ  ƒ d j | ƒ } |  j	 | t j
 | ƒ d ƒ t j ƒ  } g  } | } xt | ol d t | ƒ d }	 | j
 | |	 ƒ }
 |  j t |
 ƒ |	 k d t |
 ƒ |	 f ƒ | j |
 ƒ | j } q¼ W| o | j | j ƒ  ƒ n[ xW |
 oO | j
 d	 |	 ƒ }
 |  j t |
 ƒ |	 k d t |
 ƒ |	 f ƒ | j |
 ƒ qQW|  j	 | d j | ƒ d
 ƒ d  S(   Ni€   i    i   s    u   compressed data failurei   i
   u   chunk too big (%d>%d)u    u   Wrong data retrieved(   u   HAMLET_SCENEu   zlibu   compressobju   rangeu   lenu   appendu   compressu   flushu   joinu   assertEqualu
   decompressu   decompressobju   failIfu   unconsumed_tail(   u   selfu   flushu   datau   cou   bufsu   iu   combufu   dcou   cbu
   max_lengthu   chunk(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_decompressmaxlenÙ   s<    
 (  c             C   s   |  j  d d ƒ d  S(   Nu   flushT(   u   test_decompressmaxlenu   True(   u   self(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_decompressmaxlenflushù   s    c             C   s<   t  j ƒ  } |  j t | j d d ƒ |  j d | j ƒ d  S(   Nu    iÿÿÿÿs    (   u   zlibu   decompressobju   assertRaisesu
   ValueErroru
   decompressu   assertEqualu   unconsumed_tail(   u   selfu   dco(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_maxlenmiscü   s    c       
   	   C   sï   d d d g } d „  | Dƒ } t  d } x¿ | D]· } x® t d ƒ D]  } t j | ƒ } | j | d  d … ƒ } | j | ƒ } | j | d d  … ƒ } | j ƒ  }	 |  j t j d j | | | |	 g ƒ ƒ | d	 | | f ƒ ~ qC Wq0 Wd  S(
   Nu
   Z_NO_FLUSHu   Z_SYNC_FLUSHu   Z_FULL_FLUSHc             S   s8   g  } |  ]* } t  t | ƒ o | t t | ƒ q
 q
 S(    (   u   hasattru   zlibu   getattr(   u   .0u   _[1]u   opt(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu
   <listcomp>  s    i   i
   i¸  s    u*   Decompress failed: flush mode=%i, level=%i(	   u   HAMLET_SCENEu   rangeu   zlibu   compressobju   compressu   flushu   assertEqualu
   decompressu   join(
   u   selfu   sync_optu   datau   syncu   levelu   obju   au   bu   cu   d(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_flushes  s     
  'c       	      C   sÿ   d d  l  } t t d ƒ oß t j t j ƒ } t j ƒ  } y | j ƒ  } WnA t k
 o5 y | j ƒ  } Wn t k
 o | } Yn XYn X| j	 d ƒ t
 d d d | ƒ} | j | ƒ } | j t j ƒ } | j | | ƒ } |  j | | d ƒ n d  S(	   Ni    u   Z_SYNC_FLUSHi   i   i   u	   generatoru   17K random source doesn't matchi D  (   u   randomu   hasattru   zlibu   compressobju   Z_BEST_COMPRESSIONu   decompressobju   WichmannHillu   AttributeErroru   Randomu   seedu   genblocku   compressu   flushu   Z_SYNC_FLUSHu
   decompressu   assertEqual(	   u   selfu   randomu   cou   dcou   genu   datau   firstu   secondu   expanded(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_odd_flush  s"    c             C   sK   t  j t  j ƒ } |  j | j ƒ  ƒ t  j ƒ  } |  j | j ƒ  d ƒ d  S(   Ns    (   u   zlibu   compressobju   Z_BEST_COMPRESSIONu
   failUnlessu   flushu   decompressobju   assertEqual(   u   selfu   cou   dco(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_empty_flush8  s    u   copyc       	      C   s  t  } t t t  d ƒ j ƒ  d ƒ } t j t j ƒ } g  } | j | j | ƒ ƒ | j	 ƒ  } | d  d  … } | j | j | ƒ ƒ | j | j
 ƒ  ƒ d j | ƒ } | j | j | ƒ ƒ | j | j
 ƒ  ƒ d j | ƒ } |  j t j | ƒ | | ƒ |  j t j | ƒ | | ƒ d  S(   Nu   asciis    (   u   HAMLET_SCENEu   bytesu   stru   swapcaseu   zlibu   compressobju   Z_BEST_COMPRESSIONu   appendu   compressu   copyu   flushu   joinu   assertEqualu
   decompress(	   u   selfu   data0u   data1u   c0u   bufs0u   c1u   bufs1u   s0u   s1(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_compresscopyC  s    c             C   s:   t  j ƒ  } | j t ƒ | j ƒ  |  j t | j ƒ d  S(   N(   u   zlibu   compressobju   compressu   HAMLET_SCENEu   flushu   assertRaisesu
   ValueErroru   copy(   u   selfu   c(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_badcompresscopyY  s    
c       	      C   sû   t  } t j | ƒ } |  j t | t ƒ ƒ t j ƒ  } g  } | j | j | d  d … ƒ ƒ | j	 ƒ  } | d  d  … } | j | j | d d  … ƒ ƒ d j
 | ƒ } | j | j | d d  … ƒ ƒ d j
 | ƒ } |  j | | ƒ |  j | | ƒ d  S(   Ni    s    (   u   HAMLET_SCENEu   zlibu   compressu   assert_u
   isinstanceu   bytesu   decompressobju   appendu
   decompressu   copyu   joinu   assertEqual(	   u   selfu   datau   compu   d0u   bufs0u   d1u   bufs1u   s0u   s1(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_decompresscopya  s       c             C   sI   t  j t ƒ } t  j ƒ  } | j | ƒ | j ƒ  |  j t | j ƒ d  S(   N(	   u   zlibu   compressu   HAMLET_SCENEu   decompressobju
   decompressu   flushu   assertRaisesu
   ValueErroru   copy(   u   selfu   datau   d(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   test_baddecompresscopyx  s
    
NF(   u   __name__u
   __module__u	   test_pairu   test_compressoptionsu   test_compressincrementalu   Falseu   Noneu   test_decompincu   test_decompincflushu   test_decompimaxu   test_decompressmaxlenu   test_decompressmaxlenflushu   test_maxlenmiscu   test_flushesu   test_odd_flushu   test_empty_flushu   hasattru   zlibu   compressobju   test_compresscopyu   test_badcompresscopyu   decompressobju   test_decompresscopyu   test_baddecompresscopy(   u
   __locals__(    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   CompressObjectTestCased   s$   
			)	 				"	
		u   CompressObjectTestCasei   c                s›   |  d k	 o | j |  ƒ n | j ‰  | | k  p | d k  o
 | } n t ƒ  } x@ t d | | ƒ D], } | t ‡  f d †  t | ƒ Dƒ ƒ 7} qg W| S(   uD   length-byte stream of random data from a seed (in step-byte blocks).i   i    c             3   s   |  ] } ˆ  d  d ƒ Vq d S(   i    iÿ   N(    (   u   .0u   x(   u   randint(    u+   /mit/python/lib/python3.0/test/test_zlib.pyu	   <genexpr>‰  s    N(   u   Noneu   seedu   randintu   bytesu   range(   u   seedu   lengthu   stepu	   generatoru   blocksu   i(    (   u   randintu+   /mit/python/lib/python3.0/test/test_zlib.pyu   genblock€  s    	
	 *c                sJ   | d k	 o ˆ  j | ƒ n |  j d ƒ ‰ ‡ ‡  f d †  t | ƒ Dƒ S(   u=   Return a list of number lines randomly chosen from the sourceu   
c                s$   g  } |  ] } | ˆ j  ˆ  ƒ q
 S(    (   u   choice(   u   .0u   _[1]u   n(   u   sourcesu	   generator(    u+   /mit/python/lib/python3.0/test/test_zlib.pyu
   <listcomp>“  s    N(   u   Noneu   seedu   splitu   range(   u   sourceu   numberu   seedu	   generator(    (   u	   generatoru   sourcesu+   /mit/python/lib/python3.0/test/test_zlib.pyu   choose_linesŽ  s    s  
LAERTES

       O, fear me not.
       I stay too long: but here my father comes.

       Enter POLONIUS

       A double blessing is a double grace,
       Occasion smiles upon a second leave.

LORD POLONIUS

       Yet here, Laertes! aboard, aboard, for shame!
       The wind sits in the shoulder of your sail,
       And you are stay'd for. There; my blessing with thee!
       And these few precepts in thy memory
       See thou character. Give thy thoughts no tongue,
       Nor any unproportioned thought his act.
       Be thou familiar, but by no means vulgar.
       Those friends thou hast, and their adoption tried,
       Grapple them to thy soul with hoops of steel;
       But do not dull thy palm with entertainment
       Of each new-hatch'd, unfledged comrade. Beware
       Of entrance to a quarrel, but being in,
       Bear't that the opposed may beware of thee.
       Give every man thy ear, but few thy voice;
       Take each man's censure, but reserve thy judgment.
       Costly thy habit as thy purse can buy,
       But not express'd in fancy; rich, not gaudy;
       For the apparel oft proclaims the man,
       And they in France of the best rank and station
       Are of a most select and generous chief in that.
       Neither a borrower nor a lender be;
       For loan oft loses both itself and friend,
       And borrowing dulls the edge of husbandry.
       This above all: to thine ownself be true,
       And it must follow, as the night the day,
       Thou canst not then be false to any man.
       Farewell: my blessing season this in thee!

LAERTES

       Most humbly do I take my leave, my lord.

LORD POLONIUS

       The time invites you; go; your servants tend.

LAERTES

       Farewell, Ophelia; and remember well
       What I have said to you.

OPHELIA

       'Tis in my memory lock'd,
       And you yourself shall keep the key of it.

LAERTES

       Farewell.
c               C   s   t  j t t t t ƒ d  S(   N(   u   supportu   run_unittestu   ChecksumTestCaseu   ExceptionTestCaseu   CompressTestCaseu   CompressObjectTestCase(    (    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu	   test_mainØ  s
    u   __main__(   u   unittestu   testu   supportu   zlibu   binasciiu   randomu   TestCaseu   ChecksumTestCaseu   ExceptionTestCaseu   CompressTestCaseu   CompressObjectTestCaseu   genblocku   Noneu   choose_linesu   HAMLET_SCENEu	   test_mainu   __name__u   main(    (    (    u+   /mit/python/lib/python3.0/test/test_zlib.pyu   <module>   s   3ÿ G	