Creates a zoneinfo file following a POSIX rule.
(self, tzstr)
| 978 | cls._tzif_header = bytes(out) |
| 979 | |
| 980 | def zone_from_tzstr(self, tzstr): |
| 981 | """Creates a zoneinfo file following a POSIX rule.""" |
| 982 | zonefile = io.BytesIO(self._tzif_header) |
| 983 | zonefile.seek(0, 2) |
| 984 | |
| 985 | # Write the footer |
| 986 | zonefile.write(b"\x0A") |
| 987 | zonefile.write(tzstr.encode("ascii")) |
| 988 | zonefile.write(b"\x0A") |
| 989 | |
| 990 | zonefile.seek(0) |
| 991 | |
| 992 | return self.klass.from_file(zonefile, key=tzstr) |
| 993 | |
| 994 | def test_tzstr_localized(self): |
| 995 | for tzstr, cases in self.test_cases.items(): |
no test coverage detected