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

Method test01b_EmptyVLArray

tables/tests/test_vlarray.py:2387–2412  ·  view source on GitHub ↗

Checking empty vlarrays with different flavors (no closing file)

(self)

Source from the content-addressed store, hash-verified

2385 self.assertEqual(row, [])
2386
2387 def test01b_EmptyVLArray(self):
2388 """Checking empty vlarrays with different flavors (no closing file)"""
2389
2390 root = self.rootgroup
2391 if common.verbose:
2392 print("\n", "-=" * 30)
2393 print(
2394 "Running %s.test01_EmptyVLArray..." % self.__class__.__name__
2395 )
2396
2397 # Create an string atom
2398 vlarray = self.h5file.create_vlarray(
2399 root, "vlarray", tb.Atom.from_kind("int", itemsize=4)
2400 )
2401 vlarray.flavor = self.flavor
2402
2403 # Read all the rows (it should be empty):
2404 row = vlarray.read()
2405 if common.verbose:
2406 print("Testing flavor:", self.flavor)
2407 print("Object read:", row)
2408 print("Nrows in", vlarray._v_pathname, ":", vlarray.nrows)
2409
2410 # Check that the object read is effectively empty
2411 self.assertEqual(vlarray.nrows, 0)
2412 self.assertEqual(row, [])
2413
2414 def test02_BooleanAtom(self):
2415 """Checking vlarray with different flavors (boolean versions)"""

Callers

nothing calls this directly

Calls 3

create_vlarrayMethod · 0.80
from_kindMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected