Skip to content

Commit f117b20

Browse files
committed
Add test cases to test_strptime.py
1 parent 1e32c1d commit f117b20

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Lib/test/test_strptime.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,12 @@ def test_offset(self):
383383
one_hour = 60 * 60
384384
half_hour = 30 * 60
385385
half_minute = 30
386+
(*_, offset), _, offset_fraction = _strptime._strptime("+09", "%z")
387+
self.assertEqual(offset, 9 * one_hour)
388+
self.assertEqual(offset_fraction, 0)
389+
(*_, offset), _, offset_fraction = _strptime._strptime("-01", "%z")
390+
self.assertEqual(offset, -one_hour)
391+
self.assertEqual(offset_fraction, 0)
386392
(*_, offset), _, offset_fraction = _strptime._strptime("+0130", "%z")
387393
self.assertEqual(offset, one_hour + half_hour)
388394
self.assertEqual(offset_fraction, 0)

0 commit comments

Comments
 (0)