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

Method checkoutside

Lib/test/datetimetester.py:5698–5707  ·  view source on GitHub ↗
(self, dt, tz, utc)

Source from the content-addressed store, hash-verified

5696
5697 # Check a time that's outside DST.
5698 def checkoutside(self, dt, tz, utc):
5699 self.assertEqual(dt.dst(), ZERO)
5700
5701 # Conversion to our own timezone is always an identity.
5702 self.assertEqual(dt.astimezone(tz), dt)
5703
5704 # Converting to UTC and back is an identity too.
5705 asutc = dt.astimezone(utc)
5706 there_and_back = asutc.astimezone(tz)
5707 self.assertEqual(dt, there_and_back)
5708
5709 def convert_between_tz_and_utc(self, tz, utc):
5710 dston = self.dston.replace(tzinfo=tz)

Callers 1

Calls 3

astimezoneMethod · 0.80
assertEqualMethod · 0.45
dstMethod · 0.45

Tested by

no test coverage detected