[h5py] 373/455: Add external link tests
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:52 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to annotated tag 1.3.0
in repository h5py.
commit 63eeda6a0b3b64fa8cefea916185c4cb67990a5a
Author: andrewcollette <andrew.collette at gmail.com>
Date: Fri Jan 29 05:10:48 2010 +0000
Add external link tests
---
h5py/tests/high/test_links.py | 53 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/h5py/tests/high/test_links.py b/h5py/tests/high/test_links.py
index 76aba76..50dbb6d 100644
--- a/h5py/tests/high/test_links.py
+++ b/h5py/tests/high/test_links.py
@@ -56,5 +56,58 @@ class TestSoft(Base):
self.f['alias'] = h5py.SoftLink('new')
self.assertRaises(KeyError, self.f.__getitem__, 'alias')
+class TestExternal(Base):
+
+ def setUp(self):
+ Base.setUp(self)
+ import tempfile
+ self.ename = tempfile.mktemp()
+ self.ef = h5py.File(self.ename, 'w')
+ g = self.ef.create_group('external')
+ self.ef.close()
+
+ def tearDown(self):
+ Base.tearDown(self)
+ import os
+ os.unlink(self.ename)
+
+ @tests.require(api=18)
+ @tests.fixme("Leaks IDs by using incorrect FAPL")
+ def test_create(self):
+ """ (Links) Create and access external link """
+ self.f['ext'] = h5py.ExternalLink(self.ename, '/external')
+ g = self.f['ext']
+ self.assert_(g)
+ self.assertIsInstance(g, h5py.Group)
+
+ @tests.require(api=18)
+ def test_exc(self):
+ """ (Links) Missing external link raises KeyError """
+ self.f['ext'] = h5py.ExternalLink(self.ename, '/missing')
+ self.assertRaises(KeyError, self.f.__getitem__, 'ext')
+
+ @tests.require(api=18)
+ def test_exc1(self):
+ """ (Links) Missing external file raises IOError """
+ self.f['ext'] = h5py.ExternalLink('misssing.hdf5', '/missing')
+ self.assertRaises(IOError, self.f.__getitem__, 'ext')
+
+ @tests.fixme("Leaks IDs by using incorrect FAPL")
+ def test_file(self):
+ """ (Links) File attribute works correctly on external links """
+ self.f['ext'] = h5py.ExternalLink(self.ename, '/external')
+ g = self.f['ext']
+ self.assertNotEqual(g.file, self.f)
+
+
+
+
+
+
+
+
+
+
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/h5py.git
More information about the debian-science-commits
mailing list