Checking setting large string attributes (Node methods)
(self)
| 162 | self.assertRaises(TypeError, self.check_name, 0) |
| 163 | |
| 164 | def test02_setAttributes(self): |
| 165 | """Checking setting large string attributes (Node methods)""" |
| 166 | |
| 167 | attrlength = 2048 |
| 168 | # Try to put a long string attribute on a group object |
| 169 | self.root.agroup._f_setattr("attr1", "p" * attrlength) |
| 170 | # Now, try with a Table object |
| 171 | self.root.atable.set_attr("attr1", "a" * attrlength) |
| 172 | |
| 173 | # Finally, try with an Array object |
| 174 | self.root.anarray.set_attr("attr1", "n" * attrlength) |
| 175 | |
| 176 | if self.close: |
| 177 | if common.verbose: |
| 178 | print("(closing file version)") |
| 179 | self._reopen(mode="r+", node_cache_slots=self.node_cache_slots) |
| 180 | self.root = self.h5file.root |
| 181 | |
| 182 | self.assertEqual( |
| 183 | self.root.agroup._f_getattr("attr1"), "p" * attrlength |
| 184 | ) |
| 185 | self.assertEqual(self.root.atable.get_attr("attr1"), "a" * attrlength) |
| 186 | self.assertEqual(self.root.anarray.get_attr("attr1"), "n" * attrlength) |
| 187 | |
| 188 | def test03_setAttributes(self): |
| 189 | """Checking setting large string attributes (AttributeSet methods)""" |
nothing calls this directly
no test coverage detected