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

Method test_more_timetuple

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

Source from the content-addressed store, hash-verified

3145 self.assertEqual(result, target)
3146
3147 def test_more_timetuple(self):
3148 # This tests fields beyond those tested by the TestDate.test_timetuple.
3149 t = self.theclass(2004, 12, 31, 6, 22, 33)
3150 self.assertEqual(t.timetuple(), (2004, 12, 31, 6, 22, 33, 4, 366, -1))
3151 self.assertEqual(t.timetuple(),
3152 (t.year, t.month, t.day,
3153 t.hour, t.minute, t.second,
3154 t.weekday(),
3155 t.toordinal() - date(t.year, 1, 1).toordinal() + 1,
3156 -1))
3157 tt = t.timetuple()
3158 self.assertEqual(tt.tm_year, t.year)
3159 self.assertEqual(tt.tm_mon, t.month)
3160 self.assertEqual(tt.tm_mday, t.day)
3161 self.assertEqual(tt.tm_hour, t.hour)
3162 self.assertEqual(tt.tm_min, t.minute)
3163 self.assertEqual(tt.tm_sec, t.second)
3164 self.assertEqual(tt.tm_wday, t.weekday())
3165 self.assertEqual(tt.tm_yday, t.toordinal() -
3166 date(t.year, 1, 1).toordinal() + 1)
3167 self.assertEqual(tt.tm_isdst, -1)
3168
3169 def test_more_strftime(self):
3170 # 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