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

Method test_more_ctime

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

Source from the content-addressed store, hash-verified

2378 self.assertEqual(b.__format__(fmt), 'B')
2379
2380 def test_more_ctime(self):
2381 # Test fields that TestDate doesn't touch.
2382 import time
2383
2384 t = self.theclass(2002, 3, 2, 18, 3, 5, 123)
2385 self.assertEqual(t.ctime(), "Sat Mar 2 18:03:05 2002")
2386 # Oops! The next line fails on Win2K under MSVC 6, so it's commented
2387 # out. The difference is that t.ctime() produces " 2" for the day,
2388 # but platform ctime() produces "02" for the day. According to
2389 # C99, t.ctime() is correct here.
2390 # self.assertEqual(t.ctime(), time.ctime(time.mktime(t.timetuple())))
2391
2392 # So test a case where that difference doesn't matter.
2393 t = self.theclass(2002, 3, 22, 18, 3, 5, 123)
2394 self.assertEqual(t.ctime(), time.ctime(time.mktime(t.timetuple())))
2395
2396 def test_tz_independent_comparing(self):
2397 dt1 = self.theclass(2002, 3, 1, 9, 0, 0)

Callers

nothing calls this directly

Calls 3

assertEqualMethod · 0.45
ctimeMethod · 0.45
timetupleMethod · 0.45

Tested by

no test coverage detected