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

Method test_utcoffset

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

Source from the content-addressed store, hash-verified

315 class MyTimezone(timezone): pass
316
317 def test_utcoffset(self):
318 dummy = self.DT
319 for h in [0, 1.5, 12]:
320 offset = h * HOUR
321 self.assertEqual(offset, timezone(offset).utcoffset(dummy))
322 self.assertEqual(-offset, timezone(-offset).utcoffset(dummy))
323
324 with self.assertRaises(TypeError): self.EST.utcoffset('')
325 with self.assertRaises(TypeError): self.EST.utcoffset(5)
326
327
328 def test_dst(self):

Callers

nothing calls this directly

Calls 4

timezoneClass · 0.90
assertEqualMethod · 0.45
utcoffsetMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected