File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -269,6 +269,24 @@ def test_from_rfc3339_w_full_precision():
269
269
stamp = datetime_helpers .DatetimeWithNanoseconds .from_rfc3339 (timestamp )
270
270
assert stamp == expected
271
271
272
+ @staticmethod
273
+ @pytest .mark .parametrize (
274
+ "fractional, nanos" ,
275
+ [
276
+ ("12345678" , 123456780 ),
277
+ ("1234567" , 123456700 ),
278
+ ("123456" , 123456000 ),
279
+ ("12345" , 123450000 ),
280
+ ("1234" , 123400000 ),
281
+ ("123" , 123000000 ),
282
+ ("12" , 120000000 ),
283
+ ("1" , 100000000 ),
284
+ ],
285
+ )
286
+ def test_from_rfc3339_test_nanoseconds (fractional , nanos ):
287
+ value = "2009-12-17T12:44:32.{}Z" .format (fractional )
288
+ assert datetime_helpers .DatetimeWithNanoseconds .from_rfc3339 (value ).nanosecond == nanos
289
+
272
290
@staticmethod
273
291
def test_timestamp_pb_wo_nanos_naive ():
274
292
stamp = datetime_helpers .DatetimeWithNanoseconds (
You can’t perform that action at this time.
0 commit comments