(self)
| 1727 | self.assertIsNot(zi_rt, zi_cache) |
| 1728 | |
| 1729 | def test_from_file(self): |
| 1730 | key = "Europe/Dublin" |
| 1731 | with open(self.zoneinfo_data.path_from_key(key), "rb") as f: |
| 1732 | zi_nokey = self.klass.from_file(f) |
| 1733 | |
| 1734 | f.seek(0) |
| 1735 | zi_key = self.klass.from_file(f, key=key) |
| 1736 | |
| 1737 | test_cases = [ |
| 1738 | (zi_key, "ZoneInfo with key"), |
| 1739 | (zi_nokey, "ZoneInfo without key"), |
| 1740 | ] |
| 1741 | |
| 1742 | for zi, test_name in test_cases: |
| 1743 | for proto in range(pickle.HIGHEST_PROTOCOL + 1): |
| 1744 | with self.subTest(test_name=test_name, proto=proto): |
| 1745 | with self.assertRaises(pickle.PicklingError): |
| 1746 | pickle.dumps(zi, protocol=proto) |
| 1747 | |
| 1748 | def test_pickle_after_from_file(self): |
| 1749 | # This may be a bit of paranoia, but this test is to ensure that no |
nothing calls this directly
no test coverage detected