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

Method test03b_titleLength

tables/tests/test_create.py:113–134  ·  view source on GitHub ↗

Checking large title character length limit (1023)

(self)

Source from the content-addressed store, hash-verified

111 self.assertEqual(self.h5file.root.anarray.title, "Array title")
112
113 def test03b_titleLength(self):
114 """Checking large title character length limit (1023)"""
115
116 titlelength = 1023
117 # Try to put a very long title on a group object
118 group = self.h5file.create_group(self.root, "group", "t" * titlelength)
119 self.assertEqual(group._v_title, "t" * titlelength)
120 self.assertEqual(group._f_getattr("TITLE"), "t" * titlelength)
121
122 # Now, try with a table object
123 table = self.h5file.create_table(
124 self.root, "table", Record, "t" * titlelength
125 )
126 self.assertEqual(table.title, "t" * titlelength)
127 self.assertEqual(table.get_attr("TITLE"), "t" * titlelength)
128
129 # Finally, try with an Array object
130 arr = self.h5file.create_array(
131 self.root, "arr", [1], "t" * titlelength
132 )
133 self.assertEqual(arr.title, "t" * titlelength)
134 self.assertEqual(arr.get_attr("TITLE"), "t" * titlelength)
135
136 def test04_maxFields(self):
137 """Checking a large number of fields in tables"""

Callers

nothing calls this directly

Calls 5

create_groupMethod · 0.80
_f_getattrMethod · 0.80
get_attrMethod · 0.80
create_tableMethod · 0.45
create_arrayMethod · 0.45

Tested by

no test coverage detected