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

Method test_readFile

tables/tests/test_create.py:1762–1784  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1760 self.assertIsFile()
1761
1762 def test_readFile(self):
1763 self.h5file.close()
1764 self.h5file = None
1765
1766 self.assertIsFile()
1767
1768 # Open an existing HDF5 file
1769 self.h5file = tb.open_file(
1770 self.h5fname, mode="r", driver=self.DRIVER, **self.DRIVER_PARAMS
1771 )
1772
1773 # check contents
1774 root = self.h5file.root
1775
1776 self.assertEqual(self.h5file.get_node_attr(root, "testattr"), 41)
1777
1778 self.assertIsInstance(root.array, tb.Array)
1779 self.assertEqual(root.array._v_title, "array")
1780
1781 self.assertIsInstance(root.table, tb.Table)
1782 self.assertEqual(root.table._v_title, "table")
1783 self.assertIn("var1", root.table.colnames)
1784 self.assertEqual(root.table.cols.var1.dtype, tb.IntCol().dtype)
1785
1786 def test_openFileA(self):
1787 self.h5file.close()

Callers

nothing calls this directly

Calls 3

assertIsFileMethod · 0.95
get_node_attrMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected