(self)
| 249 | self.klass(bad_key) |
| 250 | |
| 251 | def test_bad_zones(self): |
| 252 | bad_zones = [ |
| 253 | b"", # Empty file |
| 254 | b"AAAA3" + b" " * 15, # Bad magic |
| 255 | # Truncated V2 file (should not loop indefinitely) |
| 256 | b"TZif2" + (b"\x00" * 39) + b"TZif2" + (b"\x00" * 39) + b"\n" + b"Part", |
| 257 | ] |
| 258 | |
| 259 | for bad_zone in bad_zones: |
| 260 | fobj = io.BytesIO(bad_zone) |
| 261 | with self.assertRaises(ValueError): |
| 262 | self.klass.from_file(fobj) |
| 263 | |
| 264 | def test_fromutc_errors(self): |
| 265 | key = next(iter(self.zones())) |
nothing calls this directly
no test coverage detected