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

Method testTzwinLocalTimeOnlyUTCOffset

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

Source from the content-addressed store, hash-verified

2424 self.assertEqual(dt_time(14, 10, tzinfo=twl).dst(), timedelta(0))
2425
2426 def testTzwinLocalTimeOnlyUTCOffset(self):
2427 # For zones with DST, .utcoffset() should return None
2428 with TZWinContext('Eastern Standard Time'):
2429 twl = tz.tzwinlocal()
2430 self.assertIs(dt_time(14, 10, tzinfo=twl).utcoffset(), None)
2431
2432 # This zone has no DST, so .utcoffset() returns standard offset
2433 with TZWinContext('South Africa Standard Time'):
2434 twl = tz.tzwinlocal()
2435 self.assertEqual(dt_time(14, 10, tzinfo=twl).utcoffset(),
2436 timedelta(hours=2))
2437
2438 def testTzwinLocalTimeOnlyTZName(self):
2439 # For zones with DST, the name defaults to standard time

Callers

nothing calls this directly

Calls 2

TZWinContextClass · 0.85
utcoffsetMethod · 0.45

Tested by

no test coverage detected