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

Method test_more_strftime

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

Source from the content-addressed store, hash-verified

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.
3005 t = self.theclass(2004, 12, 31, 6, 22, 33, 47)
3006 self.assertEqual(t.strftime("%m %d %y %f %S %M %H %j"),
3007 "12 31 04 000047 33 22 06 366")
3008 for (s, us), z in [((33, 123), "33.000123"), ((33, 0), "33"),]:
3009 tz = timezone(-timedelta(hours=2, seconds=s, microseconds=us))
3010 t = t.replace(tzinfo=tz)
3011 self.assertEqual(t.strftime("%z"), "-0200" + z)
3012 self.assertEqual(t.strftime("%:z"), "-02:00:" + z)
3013
3014 @unittest.skip("TODO: RUSTPYTHON")
3015 def test_strftime_special(self):

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