Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(54)  |  Call(54)  |  Derive(0)  |  Import(0)

src/h/5/h5py-2.3.0/h5py/tests/test_file.py   h5py(Download)
    def test_create_exclusive(self):
        """ Mode 'w-' opens file in exclusive mode """
        fname = self.mktemp()
        fid = File(fname, 'w-')
        self.assert_(fid)
        fid = File(fname, 'a')
        try:
            self.assert_(fid)
            fid.create_group('foo')
            self.assert_('foo' in fid)
        finally:
            fid.close()
        fid = File(fname, 'a')
        try:
            self.assert_('foo' in fid)
            self.assert_('foo' in fid)
            fid.create_group('bar')
            self.assert_('bar' in fid)
        finally:
            fid.close()

src/h/5/h5py-HEAD/h5py/tests/test_file.py   h5py(Download)
    def test_create_exclusive(self):
        """ Mode 'w-' opens file in exclusive mode """
        fname = self.mktemp()
        fid = File(fname, 'w-')
        self.assert_(fid)
        fid = File(fname, 'a')
        try:
            self.assert_(fid)
            fid.create_group('foo')
            self.assert_('foo' in fid)
        finally:
            fid.close()
        fid = File(fname, 'a')
        try:
            self.assert_('foo' in fid)
            self.assert_('foo' in fid)
            fid.create_group('bar')
            self.assert_('bar' in fid)
        finally:
            fid.close()

src/h/5/h5py-2.3.0/h5py/tests/test_group.py   h5py(Download)
        self.f1.copy(foo, 'baz', without_attrs=True)
        self.assertArrayEqual(self.f1['baz'], np.array([1,2,3]))
        self.assert_('bar' not in self.f1['baz'].attrs)
 
        self.f2.copy(foo, 'baz', without_attrs=True)
        self.assertArrayEqual(self.f2['baz'], np.array([1,2,3]))
        self.assert_('bar' not in self.f2['baz'].attrs)

src/h/5/h5py-HEAD/h5py/tests/test_group.py   h5py(Download)
        self.f1.copy(foo, 'baz', without_attrs=True)
        self.assertArrayEqual(self.f1['baz'], np.array([1,2,3]))
        self.assert_('bar' not in self.f1['baz'].attrs)
 
        self.f2.copy(foo, 'baz', without_attrs=True)
        self.assertArrayEqual(self.f2['baz'], np.array([1,2,3]))
        self.assert_('bar' not in self.f2['baz'].attrs)

src/p/r/praxes-HEAD/praxes/io/phynx/tests/test_file.py   praxes(Download)
 
        self.f['foo'] = [1, 2]
        self.assert_(isinstance(self.f.file, File))
        self.assert_(isinstance(self.f['/'].file, File))
        self.assert_(isinstance(self.f['/foo'].file, File))

src/p/r/praxes-HEAD/praxes/io/phynx/tests/test_listing.py   praxes(Download)
        b = self.f.create_group('b', 'Entry')
        b.attrs['start_time'] = 2
        self.assert_(a < b)
        c = self.f.create_group('a', 'Entry')
        c.attrs['start_time'] = 0
        self.assert_(c < a)
        self.assertTrue(a < b)
        c = self.f.create_group('15', 'Entry')
        self.assert_(b < c)
        d = self.f.create_group('1.1', 'Entry')
        self.assertTrue(a < d and d < b and d < c)

src/p/r/praxes-HEAD/praxes/io/phynx/tests/test_construction.py   praxes(Download)
    def test_unrecognized_class(self):
        a = self.f.create_group('a')
        a.attrs['class'] = 'Foo'
        self.assert_(isinstance(self.f['a'], registry['Group']))
 
    def test_unrecognized_nxclass(self):
        a = self.f._h5node.create_group('a')
        a.attrs['nx_class'] = 'Foo'
        self.assert_(isinstance(self.f['a'], registry['Group']))
    def test_class_attribute_array(self):
        a = self.f.create_group('a')
        a.attrs['class'] = np.array(['Foo'])
        self.assert_(isinstance(self.f['a'], registry['Group']))
 
    def test_class_attribute_respected(self):
        a = self.f.create_group('a')
        a.attrs['class'] = 'Measurement'
        self.assert_(isinstance(self.f['a'], registry['Measurement']))
    def test_class_attribute_saved(self):
        a = self.f.create_group('a', type='Entry')
        self.assert_(isinstance(self.f['a'], registry['Entry']))
 
    def test_use_nxclass(self):