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)
| 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 |