Ejemplo n.º 1
0
    def test_readed_with_lazy_is_compliant(self):
        '''
        Reading %s files in `files_to_test` with `lazy` is compliant.

        Test the reader with lazy = True.
        The schema must contain proxy objects.

        ''' % self.ioclass.__name__
        # This is for files presents at G-Node or generated
        if self.ioclass.support_lazy:
            for obj, path in self.iter_objects(lazy=True, return_path=True):
                try:
                    assert_sub_schema_is_lazy_loaded(obj)
                # intercept exceptions and add more information
                except BaseException as exc:
                    raise
Ejemplo n.º 2
0
    def test_readed_with_lazy_is_compliant(self):
        '''
        Reading %s files in `files_to_test` with `lazy` is compliant.

        Test the reader with lazy = True.
        The schema must contain proxy objects.

        ''' % self.ioclass.__name__
        # This is for files presents at G-Node or generated
        if self.ioclass.support_lazy:
            for obj, path in self.iter_objects(lazy=True, return_path=True):
                try:
                    assert_sub_schema_is_lazy_loaded(obj)
                # intercept exceptions and add more information
                except BaseException as exc:
                    raise
Ejemplo n.º 3
0
    def test_readed_with_lazy_is_compliant(self):
        '''
        Reading %s files in `files_to_test` with `lazy` is compliant.

        Test the reader with lazy = True.  All objects derived from ndarray
        or Quantity should have a size of 0. Also, AnalogSignal,
        AnalogSignalArray, SpikeTrain, Epoch, and Event should
        contain the lazy_shape attribute.
        ''' % self.ioclass.__name__
        # This is for files presents at G-Node or generated
        if self.ioclass.support_lazy:
            for obj, path in self.iter_objects(lazy=True, return_path=True):
                try:
                    assert_sub_schema_is_lazy_loaded(obj)
                # intercept exceptions and add more information
                except BaseException as exc:
                    raise
Ejemplo n.º 4
0
    def test_readed_with_lazy_is_compliant(self):
        '''
        Reading %s files in `files_to_test` with `lazy` is compliant.

        Test the reader with lazy = True.  All objects derived from ndarray
        or Quantity should have a size of 0. Also, AnalogSignal,
        AnalogSignalArray, SpikeTrain, Epoch, and Event should
        contain the lazy_shape attribute.
        ''' % self.ioclass.__name__
        # This is for files presents at G-Node or generated
        if self.ioclass.support_lazy:
            for obj, path in self.iter_objects(lazy=True, return_path=True):
                try:
                    assert_sub_schema_is_lazy_loaded(obj)
                # intercept exceptions and add more information
                except BaseException as exc:
                    raise
Ejemplo n.º 5
0
 def test_readed_with_lazy_is_compliant(self):
     """Reading %s files in `files_to_test` with `lazy` is compliant.
     
     This test reader with lazy = True : should return all Quantities and ndarray with size = 0.
     And should return for AnalogSignal, AnalogSignalArray, SpikeTrain, Epocharray, EventArray
     the lazy_shape attribute
     """% self.ioclass.__name__
     # This is for files presents at G-Node or generated
     for filename in self.files_to_test:
         filename = os.path.join(self.local_test_dir, filename)
         if self.ioclass.mode == 'file':
             r = self.ioclass(filename = filename)
         elif self.ioclass.mode == 'dir':
             r = self.ioclass(dirname = filename)
         else:
             continue
         ob = getattr(r, 'read_'+self.ioclass.supported_objects[0].__name__.lower())( cascade = True, lazy = True )
         assert_sub_schema_is_lazy_loaded(ob)
         
         try: # for HDF5IO file should be closed before being opened again in test
             r.close()
         except: pass