MCPcopy Index your code
hub / github.com/python/cpython / checkoutside

Method checkoutside

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

Source from the content-addressed store, hash-verified

5883
5884 # Check a time that's outside DST.
5885 def checkoutside(self, dt, tz, utc):
5886 self.assertEqual(dt.dst(), ZERO)
5887
5888 # Conversion to our own timezone is always an identity.
5889 self.assertEqual(dt.astimezone(tz), dt)
5890
5891 # Converting to UTC and back is an identity too.
5892 asutc = dt.astimezone(utc)
5893 there_and_back = asutc.astimezone(tz)
5894 self.assertEqual(dt, there_and_back)
5895
5896 def convert_between_tz_and_utc(self, tz, utc):
5897 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