Creates a zoneinfo file following a POSIX rule.
(self, tzstr)
| 1010 | cls._tzif_header = bytes(out) |
| 1011 | |
| 1012 | def zone_from_tzstr(self, tzstr): |
| 1013 | """Creates a zoneinfo file following a POSIX rule.""" |
| 1014 | zonefile = io.BytesIO(self._tzif_header) |
| 1015 | zonefile.seek(0, 2) |
| 1016 | |
| 1017 | # Write the footer |
| 1018 | zonefile.write(b"\x0A") |
| 1019 | zonefile.write(tzstr.encode("ascii")) |
| 1020 | zonefile.write(b"\x0A") |
| 1021 | |
| 1022 | zonefile.seek(0) |
| 1023 | |
| 1024 | return self.klass.from_file(zonefile, key=tzstr) |
| 1025 | |
| 1026 | def test_tzstr_localized(self): |
| 1027 | for tzstr, cases in self.test_cases.items(): |
no test coverage detected