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

Method setUp

tables/nodes/tests/test_filenode.py:359–380  ·  view source on GitHub ↗

setUp() -> None This method sets the following instance attributes: * 'datafile', the opened data file * 'h5fname', the name of the temporary HDF5 file * 'h5file', the writable, temporary HDF5 file with a '/test' node * 'fnode', the readable file node

(self)

Source from the content-addressed store, hash-verified

357 datafname = "test_filenode.xbm"
358
359 def setUp(self):
360 """setUp() -> None
361
362 This method sets the following instance attributes:
363 * 'datafile', the opened data file
364 * 'h5fname', the name of the temporary HDF5 file
365 * 'h5file', the writable, temporary HDF5 file with a '/test' node
366 * 'fnode', the readable file node in '/test', with data in it
367
368 """
369
370 self.datafname = test_file(self.datafname)
371 self.datafile = open(self.datafname, "rb")
372
373 super().setUp()
374
375 fnode = filenode.new_node(self.h5file, where="/", name="test")
376 copyFileToFile(self.datafile, fnode)
377 fnode.close()
378
379 self.datafile.seek(0)
380 self.fnode = filenode.open_node(self.h5file.get_node("/test"))
381
382 def tearDown(self):
383 """tearDown() -> None

Callers

nothing calls this directly

Calls 6

test_fileFunction · 0.85
copyFileToFileFunction · 0.85
seekMethod · 0.80
setUpMethod · 0.45
closeMethod · 0.45
get_nodeMethod · 0.45

Tested by

no test coverage detected