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

Method test02_appendFile

tables/tests/test_basics.py:188–203  ·  view source on GitHub ↗

Checking appending objects to an existing file.

(self)

Source from the content-addressed store, hash-verified

186 self.assertEqual(title, "Array example")
187
188 def test02_appendFile(self):
189 """Checking appending objects to an existing file."""
190
191 # Append a new array to the existing file
192 self._reopen(mode="r+", node_cache_slots=self.node_cache_slots)
193 self.h5file.create_array(
194 self.h5file.root, "array2", [3, 4], title="Title example 2"
195 )
196
197 # Open this file in read-only mode
198 self._reopen(node_cache_slots=self.node_cache_slots)
199
200 # Get the CLASS attribute of the arr object
201 title = self.h5file.root.array2.get_attr("TITLE")
202
203 self.assertEqual(title, "Title example 2")
204
205 def test02b_appendFile2(self):
206 """Checking appending objects to an existing file ("a" version)"""

Callers

nothing calls this directly

Calls 3

get_attrMethod · 0.80
_reopenMethod · 0.45
create_arrayMethod · 0.45

Tested by

no test coverage detected