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

Method test_more_strftime

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

Source from the content-addressed store, hash-verified

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.
3171 t = self.theclass(2004, 12, 31, 6, 22, 33, 47)
3172 self.assertEqual(t.strftime("%m %d %y %f %S %M %H %j"),
3173 "12 31 04 000047 33 22 06 366")
3174 for (s, us), z in [((33, 123), "33.000123"), ((33, 0), "33"),]:
3175 tz = timezone(-timedelta(hours=2, seconds=s, microseconds=us))
3176 t = t.replace(tzinfo=tz)
3177 self.assertEqual(t.strftime("%z"), "-0200" + z)
3178 self.assertEqual(t.strftime("%:z"), "-02:00:" + z)
3179
3180 def test_strftime_special(self):
3181 t = self.theclass(2004, 12, 31, 6, 22, 33, 47)

Callers

nothing calls this directly

Calls 5

timezoneClass · 0.90
timedeltaClass · 0.90
assertEqualMethod · 0.45
strftimeMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected