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

Method test03_setitem

tables/tests/test_enum.py:586–600  ·  view source on GitHub ↗

Changing enumerated values using ``earray.__setitem__()``.

(self)

Source from the content-addressed store, hash-verified

584 self.assertEqual(appended, read, "Written and read values differ.")
585
586 def test03_setitem(self):
587 """Changing enumerated values using ``earray.__setitem__()``."""
588
589 earr = self.h5file.create_earray(
590 "/", "test", self._atom(), shape=(0,), title=self._getMethodName()
591 )
592 earr.flavor = "python"
593
594 appended = (self.valueInEnum, self.valueInEnum)
595 earr.append(appended)
596
597 written = [self.valueInEnum, self.valueOutOfEnum]
598 earr[:] = written
599 read = earr.read()
600 self.assertEqual(written, read, "Written and read values differ.")
601
602
603class EnumVLArrayTestCase(common.TempFileMixin, common.PyTablesTestCase):

Callers

nothing calls this directly

Calls 5

_atomMethod · 0.95
create_earrayMethod · 0.80
_getMethodNameMethod · 0.80
appendMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected