We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parentb8bfce4 commitffc97edCopy full SHA for ffc97ed
api_core/tests/unit/test_datetime_helpers.py
@@ -269,6 +269,24 @@ def test_from_rfc3339_w_full_precision():
269
stamp=datetime_helpers.DatetimeWithNanoseconds.from_rfc3339(timestamp)
270
assertstamp==expected
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
+deftest_from_rfc3339_test_nanoseconds(fractional,nanos):
287
+value="2009-12-17T12:44:32.{}Z".format(fractional)
288
+assertdatetime_helpers.DatetimeWithNanoseconds.from_rfc3339(value).nanosecond==nanos
289
+
290
@staticmethod
291
deftest_timestamp_pb_wo_nanos_naive():
292
stamp=datetime_helpers.DatetimeWithNanoseconds(