ó
ŒwÛjc           @   s<  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l m Z e j d d e ƒd e j f d „  ƒ  YZ d  d l m	 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 e f d „  ƒ  YZ d e f d „  ƒ  YZ d „  Z e d k r8e ƒ  n  d S(   iÿÿÿÿN(   t   test_supportt   anydbmt
   deprecatedt   TestCasec           B   sX   e  Z d  e j d Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z RS(	   t	   shelftempt   dbc         C   s»   i  } t  j | d d d t ƒ} d d d d g | d <|  j | d d d d d g ƒ |  j t | ƒ d ƒ | j ƒ  |  j t t | ƒ y | d Wn t k
 r© n X|  j d ƒ d  S(	   Nt   protocoli   t	   writebacki   i   i   t   key1s"   Closed shelf should not find a key(	   t   shelvet   Shelft   Falset   assertEqualt   lent   closet   assertRaisest
   ValueErrort   fail(   t   selft   d1t   s(    (    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_shelve.pyt
   test_close   s     
c         C   sz   zD t  j |  j d d ƒ} d	 | d <|  j | d d
 ƒ | j ƒ  Wd  x+ t j |  j d ƒ D] } t j | ƒ q^ WXd  S(   NR   i    i   i   i   i   R   t   *(   i   i   i   i   (   i   i   i   i   (   R	   t   opent   fnR   R   t   globt   ost   unlink(   R   R   t   f(    (    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_shelve.pyt   test_ascii_file_shelf   s    
c         C   sz   zD t  j |  j d d ƒ} d | d <|  j | d d	 ƒ | j ƒ  Wd  x+ t j |  j d ƒ D] } t j | ƒ q^ WXd  S(
   NR   i   i   i   i   R   R   (   i   i   i   i   (   i   i   i   i   (   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_shelve.pyt   test_binary_file_shelf&   s    
c         C   sz   zD t  j |  j d d ƒ} d | d <|  j | d d	 ƒ | j ƒ  Wd  x+ t j |  j d ƒ D] } t j | ƒ q^ WXd  S(
   NR   i   i   i   i   R   R   (   i   i   i   i   (   i   i   i   i   (   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_shelve.pyt   test_proto2_file_shelf0   s    
c         C   s°   i  } t  j | d d ƒ} d | d <|  j | d d	 ƒ | j ƒ  i  } t  j | d d ƒ} d
 | d <|  j | d d ƒ | j ƒ  |  j t | ƒ d ƒ |  j | | ƒ d  S(   NR   i    i   i   i   i   R   (   i   i   i   i   (   i   i   i   i   (   i   i   i   i   (   i   i   i   i   (   R	   R
   R   R   R   t   assertNotEqual(   R   R   R   t   d2(    (    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_shelve.pyt   test_in_memory_shelf:   s    



c         C   sW  i  } t  j | d d d t ƒ} d d d d g | d <|  j | d d d d d g ƒ | d j d ƒ |  j | d d d d d g ƒ | j ƒ  i  } t  j | d d d t ƒ} d d d d g | d <|  j | d d d d d g ƒ | d j d ƒ |  j | d d d d d d g ƒ | j ƒ  |  j t | ƒ d ƒ |  j t | ƒ d ƒ d  S(	   NR   i   R   i   i   i   R   i   (   R	   R
   R   R   t   appendR   t   TrueR   (   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_shelve.pyt   test_mutable_entryI   s       
 #
c         C   sk   i  } t  j | d t ƒ} d g | d <| d } | d j d ƒ | j ƒ  | d } |  j | | ƒ d  S(   NR   i   t   keyi   (   R	   R
   R$   R#   R   R    (   R   t   dR   t   p1t   p2(    (    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_shelve.pyt&   test_writeback_also_writes_immediately]   s    


(   t   __name__t
   __module__R   t   extsepR   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_shelve.pyR   	   s   		
	
	
		(   t   mapping_testst   TestShelveBasec           B   sA   e  Z d  Z d Z d „  Z e j Z d „  Z d „  Z	 d „  Z
 RS(   s   shelftemp.dbi    c         O   s#   g  |  _  t j j |  | | Ž d  S(   N(   t   _dbR.   t   BasicTestMappingProtocolt   __init__(   R   t   argst   kw(    (    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_shelve.pyR2   n   s    	c         C   s   i d d 6d d 6d d 6S(	   Nt   value1R   i   t   key2i   i   t   key3(   i   i   i   (    (   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_shelve.pyt
   _referencer   s    c         C   si   |  j  r! t j i  |  j � } n4 |  j d 7_ t j |  j t |  j ƒ |  j � } |  j j	 | ƒ | S(   Ni   (
   t   _in_memR	   R
   t   _argst   counterR   R   t   strR0   R#   (   R   t   x(    (    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_shelve.pyt   _empty_mappingt   s    	%c         C   se   x |  j  D] } | j ƒ  q
 Wg  |  _  |  j sa x. t j |  j d ƒ D] } t j | ƒ qG Wn  d  S(   NR   (   R0   R   R9   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_shelve.pyt   tearDown|   s    		(   R+   R,   R   R;   R2   R	   R
   t	   type2testR8   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_shelve.pyR/   k   s   				t   TestAsciiFileShelvec           B   s   e  Z i d  d 6Z e Z RS(   i    R   (   R+   R,   R:   R   R9   (    (    (    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_shelve.pyRA   „   s   t   TestBinaryFileShelvec           B   s   e  Z i d  d 6Z e Z RS(   i   R   (   R+   R,   R:   R   R9   (    (    (    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_shelve.pyRB   ‡   s   t   TestProto2FileShelvec           B   s   e  Z i d  d 6Z e Z RS(   i   R   (   R+   R,   R:   R   R9   (    (    (    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_shelve.pyRC   Š   s   t   TestAsciiMemShelvec           B   s   e  Z i d  d 6Z e Z RS(   i    R   (   R+   R,   R:   R$   R9   (    (    (    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_shelve.pyRD   �   s   t   TestBinaryMemShelvec           B   s   e  Z i d  d 6Z e Z RS(   i   R   (   R+   R,   R:   R$   R9   (    (    (    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_shelve.pyRE   �   s   t   TestProto2MemShelvec           B   s   e  Z i d  d 6Z e Z RS(   i   R   (   R+   R,   R:   R$   R9   (    (    (    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_shelve.pyRF   “   s   c           C   s#   t  j t t t t t t t ƒ d  S(   N(	   R    t   run_unittestRA   RB   RC   RD   RE   RF   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_shelve.pyt	   test_main—   s    t   __main__(   R   t   unittestR	   R   t   testR    t   import_moduleR$   R   R.   R1   R/   RA   RB   RC   RD   RE   RF   RH   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_shelve.pyt   <module>   s"   `	