MCPcopy Create free account
hub / github.com/PyTables/PyTables / _createFile

Method _createFile

tables/tests/test_links.py:399–424  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

397 Path(extfname).unlink() # comment this for debugging purposes only
398
399 def _createFile(self):
400 self.h5file.create_array("/", "arr1", [1, 2])
401 group1 = self.h5file.create_group("/", "group1")
402 self.h5file.create_array(group1, "arr2", [1, 2, 3])
403
404 # The external file
405 extarr1 = self.exth5file.create_array("/", "arr1", [1, 2])
406 self.assertIsNotNone(extarr1)
407 extgroup1 = self.exth5file.create_group("/", "group1")
408 extarr2 = self.exth5file.create_array(extgroup1, "arr2", [1, 2, 3])
409
410 # Create external links
411 lgroup1 = self.h5file.create_external_link(
412 "/", "lgroup1", "%s:/group1" % self.extfname
413 )
414 self.assertIsNotNone(lgroup1)
415 larr1 = self.h5file.create_external_link(
416 group1, "larr1", "%s:/arr1" % self.extfname
417 )
418 self.assertIsNotNone(larr1)
419 larr2 = self.h5file.create_external_link("/", "larr2", extarr2)
420 self.assertIsNotNone(larr2)
421
422 # Re-open the external file in 'r'ead-only mode
423 self.exth5file.close()
424 self.exth5file = tb.open_file(self.extfname, "r")
425
426 def test00_create(self):
427 """Creating soft links."""

Callers 1

setUpMethod · 0.95

Calls 4

create_groupMethod · 0.80
create_external_linkMethod · 0.80
create_arrayMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected