Checking empty vlarrays with different flavors (closing the file)
(self)
| 2355 | self.rootgroup = self.h5file.root |
| 2356 | |
| 2357 | def test01a_EmptyVLArray(self): |
| 2358 | """Checking empty vlarrays with different flavors (closing the file)""" |
| 2359 | |
| 2360 | root = self.rootgroup |
| 2361 | if common.verbose: |
| 2362 | print("\n", "-=" * 30) |
| 2363 | print( |
| 2364 | "Running %s.test01_EmptyVLArray..." % self.__class__.__name__ |
| 2365 | ) |
| 2366 | |
| 2367 | # Create an string atom |
| 2368 | vlarray = self.h5file.create_vlarray( |
| 2369 | root, "vlarray", tb.Atom.from_kind("int", itemsize=4) |
| 2370 | ) |
| 2371 | vlarray.flavor = self.flavor |
| 2372 | self.h5file.close() |
| 2373 | self.h5file = tb.open_file(self.h5fname, "r") |
| 2374 | |
| 2375 | # Read all the rows (it should be empty): |
| 2376 | vlarray = self.h5file.root.vlarray |
| 2377 | row = vlarray.read() |
| 2378 | if common.verbose: |
| 2379 | print("Testing flavor:", self.flavor) |
| 2380 | print("Object read:", row, repr(row)) |
| 2381 | print("Nrows in", vlarray._v_pathname, ":", vlarray.nrows) |
| 2382 | |
| 2383 | # Check that the object read is effectively empty |
| 2384 | self.assertEqual(vlarray.nrows, 0) |
| 2385 | self.assertEqual(row, []) |
| 2386 | |
| 2387 | def test01b_EmptyVLArray(self): |
| 2388 | """Checking empty vlarrays with different flavors (no closing file)""" |
nothing calls this directly
no test coverage detected