@@ -138,6 +138,18 @@ def testConvertDateTimeValuesToJSON(self):
138138 rfc2579_date_time_object )
139139 self .assertEqual (json_dict , expected_json_dict )
140140
141+ negative_timezone_rfc2579_object = rfc2579_date_time .RFC2579DateTime (
142+ rfc2579_date_time_tuple = (2010 , 8 , 12 , 20 , 6 , 31 , 6 , '-' , 2 , 0 ))
143+
144+ expected_json_dict = {
145+ '__class_name__' : 'RFC2579DateTime' ,
146+ '__type__' : 'DateTimeValues' ,
147+ 'rfc2579_date_time_tuple' : (2010 , 8 , 12 , 20 , 6 , 31 , 6 , '-' , 2 , 0 )}
148+
149+ json_dict = serializer .Serializer .ConvertDateTimeValuesToJSON (
150+ negative_timezone_rfc2579_object )
151+ self .assertEqual (json_dict , expected_json_dict )
152+
141153 systemtime_object = systemtime .Systemtime (
142154 system_time_tuple = (2010 , 8 , 4 , 12 , 20 , 6 , 31 , 142 ))
143155
@@ -266,7 +278,8 @@ def testConvertJSONToDateTimeValues(self):
266278 '__class_name__' : 'GolangTime' ,
267279 '__type__' : 'DateTimeValues' ,
268280 'golang_timestamp' : (
269- b'\x01 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x02 \x00 \x00 \x00 \x03 \xff \xff ' )}
281+ b'\x01 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x02 \x00 \x00 \x00 \x03 \xff \xff ' ),
282+ 'time_zone_offset' : 60 }
270283
271284 golang_timestamp = bytes .fromhex ('01000000000000000200000003ffff' )
272285 expected_date_time_object = golang_time .GolangTime (
@@ -338,6 +351,17 @@ def testConvertJSONToDateTimeValues(self):
338351 json_dict )
339352 self .assertEqual (date_time_object , expected_date_time_object )
340353
354+ # Test if is_delta is removed.
355+ json_dict = {
356+ '__class_name__' : 'PosixTime' ,
357+ '__type__' : 'DateTimeValues' ,
358+ 'timestamp' : 1281643591 ,
359+ 'is_delta' : True }
360+
361+ date_time_object = serializer .Serializer .ConvertJSONToDateTimeValues (
362+ json_dict )
363+ self .assertFalse (date_time_object .is_delta )
364+
341365 with self .assertRaises (KeyError ):
342366 json_dict = {
343367 '__class_name__' : 'UnknownType' , '__type__' : 'DateTimeValues' }
0 commit comments