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

Method test_fromtimestamp

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

Source from the content-addressed store, hash-verified

1433 self.assertRaises(OverflowError, dt.__sub__, -delta)
1434
1435 def test_fromtimestamp(self):
1436 import time
1437
1438 # Try an arbitrary fixed value.
1439 year, month, day = 1999, 9, 19
1440 ts = time.mktime((year, month, day, 0, 0, 0, 0, 0, -1))
1441 d = self.theclass.fromtimestamp(ts)
1442 self.assertEqual(d.year, year)
1443 self.assertEqual(d.month, month)
1444 self.assertEqual(d.day, day)
1445
1446 def test_insane_fromtimestamp(self):
1447 # It's possible that some platform maps time_t to double,

Callers

nothing calls this directly

Calls 2

fromtimestampMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected