mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #1667546: On platforms supporting tm_zone and tm_gmtoff fields
in struct tm, time.struct_time objects returned by time.gmtime(), time.localtime() and time.strptime() functions now have tm_zone and tm_gmtoff attributes. Original patch by Paul Boddie.
This commit is contained in:
parent
f6a899fe6d
commit
c142bba2a7
6 changed files with 117 additions and 9 deletions
|
@ -78,8 +78,9 @@ class StructSeqTest(unittest.TestCase):
|
|||
|
||||
def test_fields(self):
|
||||
t = time.gmtime()
|
||||
self.assertEqual(len(t), t.n_fields)
|
||||
self.assertEqual(t.n_fields, t.n_sequence_fields+t.n_unnamed_fields)
|
||||
self.assertEqual(len(t), t.n_sequence_fields)
|
||||
self.assertEqual(t.n_unnamed_fields, 0)
|
||||
self.assertEqual(t.n_fields, time._STRUCT_TM_ITEMS)
|
||||
|
||||
def test_constructor(self):
|
||||
t = time.struct_time
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue