@@ -57,7 +57,10 @@ def test_strftime(self):
5757 ]
5858
5959 for dateTime , result in tests :
60- self .assertEqual (time .strftime ('%Y-%m-%d %H:%M:%S' ,time .struct_time (dateTime )), result )
60+ self .assertEqual (time .strftime ('%Y-%m-%d %H:%M:%S' , time .struct_time (dateTime )), result )
61+
62+ # https://github.com/IronLanguages/ironpython3/issues/1121
63+ self .assertTrue (time .strftime ("%Z%z" )) # make sure it doesn't produce an empty string
6164
6265 def test_strptime (self ):
6366 import time
@@ -77,16 +80,10 @@ def test_strptime(self):
7780 self .assertEqual ((1942 , 1 , 1 , 0 , 0 , 0 , 3 , 1 , - 1 ), time .strptime ("%1942" , "%%%Y" ))
7881 self .assertEqual ((1900 , 1 , 6 , 0 , 0 , 0 , 5 , 6 , - 1 ), time .strptime ("%6" , "%%%d" ))
7982
80- if is_cli : # https://github.com/IronLanguages/main/issues/239
81- # TODO: day of the week does not work as expected
82- import System .DateTime
83- if System .DateTime (System .DateTime .Now .Year , 7 , 9 ).DayOfWeek == System .DayOfWeek .Friday :
84- self .assertEqual ((1900 , 7 , 9 , 19 , 30 , 0 , 4 , 190 , - 1 ), time .strptime ('Fri, July 9 7:30 PM' , '%a, %B %d %I:%M %p' ))
85- else :
86- with self .assertRaises (ValueError ):
87- time .strptime ('Fri, July 9 7:30 PM' , '%a, %B %d %I:%M %p' )
88- else :
89- self .assertEqual ((1900 , 7 , 9 , 19 , 30 , 0 , 4 , 190 , - 1 ), time .strptime ('Fri, July 9 7:30 PM' , '%a, %B %d %I:%M %p' ))
83+ # https://github.com/IronLanguages/main/issues/239
84+ self .assertEqual (time .strptime ('Fri' , '%a' ), (1900 , 1 , 1 , 0 , 0 , 0 , 4 , 1 , - 1 ))
85+ for i , d in enumerate (('Mon' , 'Tue' , 'Wed' , 'Thu' , 'Fri' , 'Sat' , 'Sun' )):
86+ self .assertEqual ((1900 , 7 , 9 , 19 , 30 , 0 , i , 190 , - 1 ), time .strptime (d + ', July 9 7:30 PM' , '%a, %B %d %I:%M %p' ))
9087
9188 self .assertEqual ((1900 , 7 , 9 , 19 , 30 , 0 , 0 , 190 , - 1 ), time .strptime ('July 9 7:30 PM' , '%B %d %I:%M %p' ))
9289 # CPY & IPY differ on daylight savings time for this parse
0 commit comments