ó
\c           @À  sL  d  Z  d d l m Z m Z d d l Z d d l Z d d l m Z d d l Z d d l	 Z	 d d l
 m Z m Z m Z m Z d d l m Z d d l Z y d d l Z Wn e k
 rÃ d Z n Xe j ƒ  j Z 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 e j e d ƒ d e f d „  ƒ  Yƒ Z 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# e f d$ „  ƒ  YZ$ e j e d k d% ƒ d& e f d' „  ƒ  Yƒ Z% d S((   s`   
    File object test module.

    Tests all aspects of File objects, including their creation.
i    (   t   absolute_importt   with_statementN(   t   platformi   (   t   utt   TestCaset   UNICODE_FILENAMESt   closed_tempfile(   t   Filet   TestFileOpenc           BÀ  sV   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   s=   
        Feature: Opening files with Python-style modes.
    c         CÀ  s  |  j  ƒ  } t | ƒ ' } |  j | ƒ |  j | j d ƒ Wd QXt j | t j ƒ t j | ƒ j	 d k r~ t
 d k r~ d n d } z9 t | ƒ ' } |  j | ƒ |  j | j | ƒ Wd QXWd t j | t j ƒ Xt | d ƒ  } | j d ƒ Wd QX|  j t ƒ  t | ƒ Wd QXd S(   s8    Default semantics in the presence or absence of a file s   r+Ni    t   win32t   rt   wbs    (   t   mktempR   t
   assertTruet   assertEqualt   modet   ost   chmodt   statt   S_IREADt   st_uidR   t   S_IWRITEt   opent   writet   assertRaisest   IOError(   t   selft   fnamet   ft   exp_mode(    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_default*   s    0c         CÀ  sl   |  j  ƒ  } t | d ƒ } |  j | ƒ | j d ƒ | j ƒ  t | d ƒ } |  j d | ƒ | j ƒ  d S(   s'    Mode 'w' opens file in overwrite mode t   wt   fooN(   R   R   R   t   create_groupt   closet   assertNotIn(   R   R   t   fid(    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_createF   s    
c         CÀ  sY   |  j  ƒ  } t | d ƒ } |  j | ƒ | j ƒ  |  j t ƒ  t | d ƒ Wd QXd S(   s(    Mode 'w-' opens file in exclusive mode s   w-N(   R   R   t   assert_R"   R   R   (   R   R   R$   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_create_exclusiveQ   s    
c         CÀ  s²   |  j  ƒ  } t | d ƒ } z1 |  j | ƒ | j d ƒ |  j d | k ƒ Wd | j ƒ  Xt | d ƒ } z7 |  j d | k ƒ | j d ƒ |  j d | k ƒ Wd | j ƒ  Xd S(   sE    Mode 'a' opens file in append/readwrite mode, creating if necessary t   aR    Nt   bar(   R   R   R&   R!   R"   (   R   R   R$   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_appendZ   s    c         CÀ  s€   |  j  ƒ  } t | d ƒ } | j ƒ  |  j | ƒ t | d ƒ } |  j | ƒ |  j t ƒ  | j d ƒ Wd QX| j ƒ  d S(   s&    Mode 'r' opens file in readonly mode R   R
   R    N(   R   R   R"   R&   R   t
   ValueErrorR!   (   R   R   R$   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_readonlyl   s    
c         CÀ  s‚   |  j  ƒ  } t | d ƒ } | j d ƒ | j ƒ  t | d ƒ } |  j d | k ƒ | j d ƒ |  j d | k ƒ | j ƒ  d S(   s1    Mode 'r+' opens existing file in readwrite mode R   R    s   r+R)   N(   R   R   R!   R"   R&   (   R   R   R$   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_readwritex   s    
c         CÀ  sV   |  j  ƒ  } |  j t ƒ  t | d ƒ Wd QX|  j t ƒ  t | d ƒ Wd QXd S(   s(    Modes 'r' and 'r+' do not create files R
   Ns   r+(   R   R   R   R   (   R   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_nonexistent_file„   s
    c         CÀ  s-   |  j  t ƒ  t |  j ƒ  d ƒ Wd QXd S(   s     Invalid modes raise ValueError t   mongooseN(   R   R+   R   R   (   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_invalid_modeŒ   s    (   t   __name__t
   __module__t   __doc__R   R%   R'   R*   R,   R-   R.   R0   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyR   $   s   								t	   TestModesc           BÀ  s    e  Z d  Z d „  Z d „  Z RS(   s?   
        Feature: File mode can be retrieved via file.mode
    c         CÀ  sf   |  j  ƒ  } t | d ƒ  } |  j | j d ƒ Wd QXt | d ƒ  } |  j | j d ƒ Wd QXd S(   s/    Mode equivalent can be retrieved via property R   s   r+NR
   (   R   R   R   R   (   R   R   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_mode_attr—   s
    c         CÀ  sá   |  j  ƒ  } |  j  ƒ  } t | d ƒ } | j ƒ  t | d ƒ } z: t j | d ƒ | d <| d j } |  j | j d ƒ Wd | j ƒ  | j ƒ  Xt | d ƒ } z$ | d j } |  j | j d ƒ Wd | j ƒ  | j ƒ  Xd S(   sU    Mode property works for files opened via external links

        Issue 190.
        R   t   /t   Externals   r+NR
   (   R   R   R"   t   h5pyt   ExternalLinkt   fileR   R   (   R   t   fname1t   fname2t   f1t   f2t   f3(    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_mode_externalŸ   s"    


(   R1   R2   R3   R5   R@   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyR4   ‘   s   	t   TestDriversc           BÀ  sÎ   e  Z d  Z e j e j d k d ƒ d „  ƒ Z e j e j d k d ƒ d „  ƒ Z d „  Z	 d „  Z
 d „  Z d	 „  Z e j e d
 ƒ d „  ƒ Z e j e d ƒ e j e j j d k  d ƒ d „  ƒ ƒ Z RS(   sF   
        Feature: Files can be opened with low-level HDF5 drivers
    t   posixs"   Stdio driver is supported on posixc         CÀ  sI   t  |  j ƒ  d d d ƒ} |  j | ƒ |  j | j d ƒ | j ƒ  d S(   s$    Stdio driver is supported on posix R   t   drivert   stdioN(   R   R   R   R   RC   R"   (   R   R$   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt
   test_stdioÁ   s    s!   Sec2 driver is supported on posixc         CÀ  sI   t  |  j ƒ  d d d ƒ} |  j | ƒ |  j | j d ƒ | j ƒ  d S(   s#    Sec2 driver is supported on posix R   RC   t   sec2N(   R   R   R&   R   RC   R"   (   R   R$   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt	   test_sec2É   s    c         CÀ  sn   |  j  ƒ  } t | d d d d t ƒ} |  j | ƒ |  j | j d ƒ | j ƒ  |  j t j	 j
 | ƒ ƒ d S(   s-    Core driver is supported (no backing store) R   RC   t   coret   backing_storeN(   R   R   t   FalseR&   R   RC   R"   t   assertFalseR   t   patht   exists(   R   R   R$   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt	   test_coreÑ   s    
c         CÀ  sn   |  j  ƒ  } t | d d d d t ƒ} | j d ƒ | j ƒ  t | d ƒ } |  j d | k ƒ | j ƒ  d S(   s3    Core driver saves to file when backing store used R   RC   RH   RI   R    R
   N(   R   R   t   TrueR!   R"   R&   (   R   R   R$   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_backingÚ   s    
c         CÀ  s˜   |  j  ƒ  } t | d ƒ } | j d ƒ | j ƒ  t | d d d ƒ} |  j | ƒ |  j d | k ƒ |  j t ƒ  | j d ƒ Wd QX| j ƒ  d S(   s0    Core driver can be used to open existing files R   R    R
   RC   RH   R)   N(   R   R   R!   R"   R&   R   R+   (   R   R   R$   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyR,   ä   s    
c      	   CÀ  sH   |  j  ƒ  } t | d d d d d d t ƒ} |  j | ƒ | j ƒ  d S(   s*    Core driver supports variable block size R   RC   RH   t
   block_sizei   RI   N(   R   R   RJ   R&   R"   (   R   R   R$   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_blocksizeñ   s
    	s.   Parallel HDF5 is required for MPIO driver testc         CÀ  sg   d d l  m } |  j ƒ  } t | d d d d | j ƒ' } |  j | ƒ |  j | j d ƒ Wd QXd S(   s    MPIO driver and options i    (   t   MPIR   RC   t   mpiot   commN(   t   mpi4pyRS   R   R   t
   COMM_WORLDR   R   RC   (   R   RS   R   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt	   test_mpioù   s
    !s   Parallel HDF5 requiredi   i   i	   s5   mpio atomic file operations were added in HDF5 1.8.9+c         CÀ  sp   d d l  m } |  j ƒ  } t | d d d d | j ƒ0 } |  j | j ƒ t | _ |  j | j ƒ Wd QXd S(   s$    Enable atomic mode for MPIO driver i    (   RS   R   RC   RT   RU   N(	   RV   RS   R   R   RW   RK   t   atomicRO   R   (   R   RS   R   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_mpi_atomic  s    !	(   i   i   i	   (   R1   R2   R3   R   t
   skipUnlessR   t   nameRE   RG   RN   RP   R,   RR   t   mpiRX   t   skipIfR8   t   versiont   hdf5_version_tupleRZ   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyRA   »   s   $$			
		
t
   TestLibverc           BÀ  s2   e  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   se   
        Feature: File format compatibility bounds can be specified when
        opening a file.
    c         CÀ  s6   t  |  j ƒ  d ƒ } |  j | j d ƒ | j ƒ  d S(   s    Opening with no libver arg R   t   earliestt   latestN(   Rb   Rc   (   R   R   R   t   libverR"   (   R   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyR     s    c         CÀ  s<   t  |  j ƒ  d d d ƒ} |  j | j d ƒ | j ƒ  d S(   s     Opening with single libver arg R   Rd   Rc   N(   Rc   Rc   (   R   R   R   Rd   R"   (   R   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_single  s    c         CÀ  s<   t  |  j ƒ  d d d ƒ} |  j | j d ƒ | j ƒ  d S(   s    Opening with two libver args R   Rd   Rb   Rc   N(   Rb   Rc   (   Rb   Rc   (   R   R   R   Rd   R"   (   R   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_multiple%  s    c         CÀ  s6   t  |  j ƒ  d ƒ } |  j | j d ƒ | j ƒ  d S(   s6    Omitting libver arg results in maximum compatibility R   Rb   Rc   N(   Rb   Rc   (   R   R   R   Rd   R"   (   R   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt	   test_none+  s    (   R1   R2   R3   R   Re   Rf   Rg   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyRa     s
   			t   TestUserblockc           BÀ  s;   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s;   
        Feature: Files can be create with user blocks
    c         CÀ  sÄ   t  |  j ƒ  d d d ƒ} z |  j | j d ƒ Wd | j ƒ  Xt  |  j ƒ  d d d ƒ} z |  j | j d ƒ Wd | j ƒ  Xt  |  j ƒ  d d d ƒ} z |  j | j d ƒ Wd | j ƒ  Xd S(   sA    User blocks created with w, w-, x and properties work correctly s   w-t   userblock_sizei   Nt   xR   (   R   R   R   Ri   R"   (   R   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_create_blocksize7  s    c      
   CÀ  s…   |  j  ƒ  } t | d ƒ } | j ƒ  |  j t ƒ  t j | d d d ƒ} Wd QX|  j t ƒ  t j | d d d ƒ} Wd QXd S(   s#    User block only allowed for write R   R
   Ri   i   Ns   r+(   R   R   R"   R   R+   R8   (   R   R\   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_write_onlyK  s    
c      	   CÀ  s”   |  j  ƒ  } t | d d d ƒ} | j ƒ  |  j t ƒ  t | d d d ƒ} Wd QXt | d d d ƒ} z |  j | j d ƒ Wd | j ƒ  Xd S(   sA    User block size must match that of file when opening for append R   Ri   i   R(   i   N(   R   R   R"   R   R+   R   Ri   (   R   R\   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_match_existingW  s    
c         CÀ  s‘   |  j  ƒ  } |  j t ƒ  t | d d d ƒ} Wd QX|  j t ƒ  t | d d d ƒ} Wd QX|  j t ƒ  t | d d d ƒ} Wd QXd S(   s7    User block size must be a power of 2 and at least 512 R   Ri   i€   Ni  iÿ  (   R   R   R+   R   (   R   R\   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_power_of_twof  s    c         CÀ  sã   |  j  ƒ  } t | d d d ƒ} | j d ƒ | j ƒ  t | d ƒ } z | j d d ƒ Wd | j ƒ  Xt j | d ƒ } z |  j d | k ƒ Wd | j ƒ  Xt | d	 ƒ } z! |  j | j	 d ƒ d d ƒ Wd | j ƒ  Xd S(
   s=    Test that writing to a user block does not destroy the file R   Ri   i   t   Foobars   r+bt   XNR
   t   rb(
   R   R   R!   R"   R   R   R8   R&   R   t   read(   R   R\   R   t   pyfile(    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_write_blocks  s     
!(   R1   R2   R3   Rk   Rl   Rm   Rn   Rt   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyRh   1  s   				t   TestContextManagerc           BÀ  s   e  Z d  Z d „  Z RS(   sC   
        Feature: File objects can be used as context managers
    c         CÀ  s=   t  |  j ƒ  d ƒ  } |  j | ƒ Wd QX|  j | ƒ d S(   s-    File objects can be used in with statements R   N(   R   R   R   (   R   R$   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_context_manager“  s    (   R1   R2   R3   Rv   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyRu     s   s#   Filesystem unicode support requiredt   TestUnicodec           BÀ  s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s6   
        Feature: Unicode filenames are supported
    c         CÀ  si   |  j  d t j d ƒ ƒ } t | d ƒ } z- |  j | j | ƒ |  j | j t j ƒ Wd | j ƒ  Xd S(   sM    Unicode filenames can be used, and retrieved properly via .filename
        t   prefixi   R   N(	   R   t   sixt   unichrR   R   t   filenamet   assertIsInstancet	   text_typeR"   (   R   R   R$   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_unicode   s    c         CÀ  sP   |  j  d t j d ƒ ƒ } t | d ƒ   } |  j t j j | ƒ ƒ Wd QXd S(   sG    Unicode filenames can be used, and seen correctly from python
        Rx   i   R   N(   R   Ry   Rz   R   R   R   RL   RM   (   R   R   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt#   test_unicode_hdf5_python_consistent«  s    c         CÀ  se   |  j  d t j d ƒ ƒ } |  j t ƒ  t | d ƒ Wd QX|  j t ƒ  t | d ƒ Wd QXd S(   sV   
        Modes 'r' and 'r+' do not create files even when given unicode names
        Rx   i   R
   Ns   r+(   R   Ry   Rz   R   R   R   (   R   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_nonexistent_file_unicode²  s
    (   R1   R2   R3   R~   R   R€   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyRw   ™  s   		t   TestFilePropertyc           BÀ  s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   sk   
        Feature: A File object can be retrieved from any child object,
        via the .file property
    c         CÀ  sN   |  j  ƒ  } t | d ƒ } z! | d j } |  j | | ƒ Wd | j ƒ  Xd S(   s,    File object can be retrieved from subgroup R   R6   N(   R   R   R:   R   R"   (   R   R   t   hfilet   hfile2(    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_propertyÄ  s    c         CÀ  su   |  j  ƒ  } t | d ƒ } | j d ƒ } | j } | d j } | j ƒ  |  j | ƒ |  j | ƒ |  j | ƒ d S(   s8    All retrieved File objects are closed at the same time R   R    R6   N(   R   R   R!   R:   R"   RK   (   R   R   R‚   t   grpRƒ   t   hfile3(    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt
   test_closeÎ  s    	
c         CÀ  sS   t  |  j ƒ  d ƒ } z, | j d ƒ } |  j | j j | j ƒ Wd | j ƒ  Xd S(   s9    Retrieved File objects have a meaningful mode attribute R   R    N(   R   R   R!   R   R:   R   R"   (   R   R‚   R…   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt	   test_modeÚ  s
    (   R1   R2   R3   R„   R‡   Rˆ   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyR   ½  s   	
	t	   TestClosec           BÀ  sD   e  Z d  Z d „  Z d „  Z d „  Z e j e d ƒ d „  ƒ Z	 RS(   s*   
        Feature: Files can be closed
    c         CÀ  s;   t  |  j ƒ  ƒ } |  j | ƒ | j ƒ  |  j | ƒ d S(   s    Close file via .close method N(   R   R   R&   R"   (   R   R$   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyR‡   é  s    
c         CÀ  sF   t  |  j ƒ  d ƒ } | j ƒ  |  j t ƒ  | j d ƒ Wd QXd S(   s0    Trying to modify closed file raises ValueError R   R    N(   R   R   R"   R   R+   R!   (   R   R$   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_closed_fileð  s    
c         CÀ  sC   |  j  ƒ  } t j | d ƒ } | j d ƒ | j ƒ  | j ƒ  d  S(   NR   t   test(   R   R8   R   R!   R"   (   R   R   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt"   test_close_multiple_default_driver÷  s
    
s.   Parallel HDF5 is required for MPIO driver testc         CÀ  s_   d d l  m } |  j ƒ  } t | d d d d | j ƒ} | j d ƒ | j ƒ  | j ƒ  d S(	   s    MPIO driver and options i    (   RS   R   RC   RT   RU   R‹   N(   RV   RS   R   R   RW   R!   R"   (   R   RS   R   R   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_close_multiple_mpio_driverþ  s    
(
   R1   R2   R3   R‡   RŠ   RŒ   R   R[   R]   R   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyR‰   ã  s
   			t	   TestFlushc           BÀ  s   e  Z d  Z d „  Z RS(   s+   
        Feature: Files can be flushed
    c         CÀ  s-   t  |  j ƒ  d ƒ } | j ƒ  | j ƒ  d S(   s    Flush via .flush method R   N(   R   R   t   flushR"   (   R   R$   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt
   test_flush  s    
(   R1   R2   R3   R   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyRŽ   	  s   t   TestReprc           BÀ  s   e  Z d  Z d „  Z RS(   sE   
        Feature: File objects provide a helpful __repr__ string
    c         CÀ  sR   t  |  j ƒ  ƒ } |  j t | ƒ t j ƒ | j ƒ  |  j t | ƒ t j ƒ d S(   s8    __repr__ behaves itself when files are open and closed N(   R   R   R|   t   reprRy   t   string_typesR"   (   R   R$   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt	   test_repr  s    
(   R1   R2   R3   R”   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyR‘     s   t   TestFilenamec           BÀ  s   e  Z d  Z d „  Z RS(   sO   
        Feature: The name of a File object can be retrieved via .filename
    c         CÀ  sZ   |  j  ƒ  } t | d ƒ } z- |  j | j | ƒ |  j | j t j ƒ Wd | j ƒ  Xd S(   s,    .filename behaves properly for string data R   N(   R   R   R   R{   R|   Ry   R}   R"   (   R   R   R$   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_filename)  s    (   R1   R2   R3   R–   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyR•   #  s   t   TestBackwardsCompatc           BÀ  s   e  Z d  Z d „  Z RS(   sM   
        Feature: Deprecated attributes are included to support 1.3 code
    c         CÀ  s8   t  |  j ƒ  d ƒ  } |  j | j | j ƒ Wd QXd S(   s>    File objects provide a .fid attribute aliased to the file ID R   N(   R   R   t   assertIsR$   t   id(   R   R‚   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_fid9  s    (   R1   R2   R3   Rš   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyR—   3  s   t!   TestCloseInvalidatesOpenObjectIDsc           BÀ  s   e  Z d  Z d „  Z RS(   sO   
        Ensure that closing a file invalidates object IDs, as appropriate
    c         CÀ  s  t  |  j ƒ  d ƒ x } | j d ƒ } |  j t | j ƒ ƒ |  j t | j ƒ ƒ | j ƒ  |  j t | j ƒ ƒ |  j t | j ƒ ƒ Wd QXt  |  j ƒ  d ƒ n } | j d ƒ } |  j t | j ƒ ƒ |  j t | j ƒ ƒ |  j t | j ƒ ƒ |  j t | j ƒ ƒ Wd QXd S(   s;    Closing a file invalidates any of the file's open objects R   R    N(   R   R   R!   R   t   boolR™   R"   RK   (   R   R=   t   g1R>   t   g2(    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyR‡   E  s    
(   R1   R2   R3   R‡   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyR›   ?  s   s   pathlib module not installedt   TestPathlibSupportc           BÀ  s    e  Z d  Z d „  Z d „  Z RS(   s6   
        Check that h5py doesn't break on pathlib
    c      
   CÀ  sG   t  ƒ  8 } t j | ƒ } t | ƒ  } |  j t ƒ Wd QXWd QXd S(   s-    Check that pathlib is accepted by h5py.File N(   R   t   pathlibt   PathR   R   RO   (   R   R   RL   R>   (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_pathlib_accepted_file[  s    c      
   CÀ  sq   t  ƒ  b } t j | ƒ } t | ƒ  } | j } Wd QXt | ƒ  } | j } Wd QX|  j | | ƒ Wd QXd S(   s1    Check that using pathlib does not affect naming N(   R   R    R¡   R   R{   R   (   R   R   RL   t   h5f1t   pathlib_namet   h5f2t   normal_name(    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   test_pathlib_name_matchb  s    (   R1   R2   R3   R¢   R§   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyRŸ   U  s   	(&   R3   t
   __future__R    R   R   R   t   sysR   t   tempfileRy   t   commonR   R   R   R   R8   R   R    t   ImportErrort   Nonet
   get_configR]   R   R4   RA   Ra   Rh   Ru   R^   Rw   R   R‰   RŽ   R‘   R•   R—   R›   RŸ   (    (    (    s7   lib/python2.7/site-packages/h5py/tests/old/test_file.pyt   <module>   s<   "
m*W\#&&