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

Method test_more_timetuple

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

Source from the content-addressed store, hash-verified

2979 self.theclass.strptime('02-29,2024', '%m-%d,%Y')
2980
2981 def test_more_timetuple(self):
2982 # This tests fields beyond those tested by the TestDate.test_timetuple.
2983 t = self.theclass(2004, 12, 31, 6, 22, 33)
2984 self.assertEqual(t.timetuple(), (2004, 12, 31, 6, 22, 33, 4, 366, -1))
2985 self.assertEqual(t.timetuple(),
2986 (t.year, t.month, t.day,
2987 t.hour, t.minute, t.second,
2988 t.weekday(),
2989 t.toordinal() - date(t.year, 1, 1).toordinal() + 1,
2990 -1))
2991 tt = t.timetuple()
2992 self.assertEqual(tt.tm_year, t.year)
2993 self.assertEqual(tt.tm_mon, t.month)
2994 self.assertEqual(tt.tm_mday, t.day)
2995 self.assertEqual(tt.tm_hour, t.hour)
2996 self.assertEqual(tt.tm_min, t.minute)
2997 self.assertEqual(tt.tm_sec, t.second)
2998 self.assertEqual(tt.tm_wday, t.weekday())
2999 self.assertEqual(tt.tm_yday, t.toordinal() -
3000 date(t.year, 1, 1).toordinal() + 1)
3001 self.assertEqual(tt.tm_isdst, -1)
3002
3003 def test_more_strftime(self):
3004 # This tests fields beyond those tested by the TestDate.test_strftime.

Callers

nothing calls this directly

Calls 5

dateClass · 0.90
toordinalMethod · 0.80
assertEqualMethod · 0.45
timetupleMethod · 0.45
weekdayMethod · 0.45

Tested by

no test coverage detected