MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_aware_datetime

Method test_aware_datetime

Lib/test/datetimetester.py:385–394  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

383 self.assertTrue(tz >= SMALLEST)
384
385 def test_aware_datetime(self):
386 # test that timezone instances can be used by datetime
387 t = datetime(1, 1, 1)
388 for tz in [timezone.min, timezone.max, timezone.utc]:
389 self.assertEqual(tz.tzname(t),
390 t.replace(tzinfo=tz).tzname())
391 self.assertEqual(tz.utcoffset(t),
392 t.replace(tzinfo=tz).utcoffset())
393 self.assertEqual(tz.dst(t),
394 t.replace(tzinfo=tz).dst())
395
396 def test_pickle(self):
397 for tz in self.ACDT, self.EST, timezone.min, timezone.max:

Callers

nothing calls this directly

Calls 6

datetimeClass · 0.90
assertEqualMethod · 0.45
tznameMethod · 0.45
replaceMethod · 0.45
utcoffsetMethod · 0.45
dstMethod · 0.45

Tested by

no test coverage detected