(self)
| 173 | self.assertEqual(str(zi_ff), repr(zi_ff)) |
| 174 | |
| 175 | def test_repr(self): |
| 176 | # The repr is not guaranteed, but I think we can insist that it at |
| 177 | # least contain the name of the class. |
| 178 | key = next(iter(self.zones())) |
| 179 | |
| 180 | zi = self.klass(key) |
| 181 | class_name = self.class_name |
| 182 | with self.subTest(name="from key"): |
| 183 | self.assertRegex(repr(zi), class_name) |
| 184 | |
| 185 | file_key = self.zoneinfo_data.keys[0] |
| 186 | file_path = self.zoneinfo_data.path_from_key(file_key) |
| 187 | with open(file_path, "rb") as f: |
| 188 | zi_ff = self.klass.from_file(f, key=file_key) |
| 189 | |
| 190 | with self.subTest(name="from file with key"): |
| 191 | self.assertRegex(repr(zi_ff), class_name) |
| 192 | |
| 193 | with open(file_path, "rb") as f: |
| 194 | zi_ff_nk = self.klass.from_file(f) |
| 195 | |
| 196 | with self.subTest(name="from file without key"): |
| 197 | self.assertRegex(repr(zi_ff_nk), class_name) |
| 198 | |
| 199 | def test_key_attribute(self): |
| 200 | key = next(iter(self.zones())) |
nothing calls this directly
no test coverage detected