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

Method test_utcoffset

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

Source from the content-addressed store, hash-verified

310 class MyTimezone(timezone): pass
311
312 def test_utcoffset(self):
313 dummy = self.DT
314 for h in [0, 1.5, 12]:
315 offset = h * HOUR
316 self.assertEqual(offset, timezone(offset).utcoffset(dummy))
317 self.assertEqual(-offset, timezone(-offset).utcoffset(dummy))
318
319 with self.assertRaises(TypeError): self.EST.utcoffset('')
320 with self.assertRaises(TypeError): self.EST.utcoffset(5)
321
322
323 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