(self, datetime_ambiguous_mock)
| 281 | |
| 282 | @patch('dateutil.tz.datetime_ambiguous') |
| 283 | def test_when_is_ambiguous(self, datetime_ambiguous_mock): |
| 284 | class tzz(tzinfo): |
| 285 | |
| 286 | def utcoffset(self, dt): |
| 287 | return None # Mock no utcoffset specified |
| 288 | |
| 289 | def is_ambiguous(self, dt): |
| 290 | return True |
| 291 | |
| 292 | datetime_ambiguous_mock.return_value = False |
| 293 | tz = tzz() |
| 294 | assert localize(make_aware(datetime.now(_timezone.utc), tz), tz) |
| 295 | |
| 296 | datetime_ambiguous_mock.return_value = True |
| 297 | tz2 = tzz() |
| 298 | assert localize(make_aware(datetime.now(_timezone.utc), tz2), tz2) |
| 299 | |
| 300 | def test_localize_changes_utc_dt(self): |
| 301 | now_utc_time = datetime.now(tz=ZoneInfo("UTC")) |
nothing calls this directly
no test coverage detected