MCPcopy Create free account
hub / github.com/dateutil/dateutil / testGMTOffset

Method testGMTOffset

tests/test_tz.py:2156–2163  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2154 self.assertEqual(tz.gettz("GMT+2").dst(dt), timedelta(0))
2155
2156 def testGMTOffset(self):
2157 # GMT and UTC offsets have inverted signal when compared to the
2158 # usual TZ variable handling.
2159 dt = datetime(2007, 8, 6, 4, 10, tzinfo=tz.UTC)
2160 self.assertEqual(dt.astimezone(tz=tz.tzstr("GMT+2")),
2161 datetime(2007, 8, 6, 6, 10, tzinfo=tz.tzstr("GMT+2")))
2162 self.assertEqual(dt.astimezone(tz=tz.gettz("UTC-2")),
2163 datetime(2007, 8, 6, 2, 10, tzinfo=tz.tzstr("UTC-2")))
2164
2165 @unittest.skipIf(IS_WIN, "requires Unix")
2166 def testTZSetDoesntCorrupt(self):

Callers

nothing calls this directly

Calls 1

gettzMethod · 0.45

Tested by

no test coverage detected