MCPcopy Index your code
hub / github.com/PyTables/PyTables / test01

Method test01

tables/tests/test_numpy.py:1349–1367  ·  view source on GitHub ↗

Checking the lengths of strings (read field).

(self)

Source from the content-addressed store, hash-verified

1347 self.table.flush()
1348
1349 def test01(self):
1350 """Checking the lengths of strings (read field)."""
1351
1352 if self.close:
1353 self._reopen(mode="a")
1354 self.table = self.h5file.root.group.table
1355
1356 # Get both strings
1357 str1 = self.table.col("Text")[0]
1358 str2 = self.table.col("Text")[1]
1359 if common.verbose:
1360 print("string1-->", str1)
1361 print("string2-->", str2)
1362
1363 # Check that both NumPy objects are equal
1364 self.assertEqual(len(str1), len(b"Hello Francesc!"))
1365 self.assertEqual(len(str2), len(b"Hola Francesc!"))
1366 self.assertEqual(str1, b"Hello Francesc!")
1367 self.assertEqual(str2, b"Hola Francesc!")
1368
1369 def test02(self):
1370 """Checking the lengths of strings (read recarray)."""

Callers

nothing calls this directly

Calls 2

colMethod · 0.80
_reopenMethod · 0.45

Tested by

no test coverage detected