From 9ef43a29d99a7b14167d0bc2d3be125502da1658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20St=C3=B6r?= Date: Mon, 14 May 2018 21:49:47 +0200 Subject: [PATCH] Add RFC3339 unit test --- tests/test_maya.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_maya.py b/tests/test_maya.py index 39377d7..8082c02 100644 --- a/tests/test_maya.py +++ b/tests/test_maya.py @@ -245,6 +245,11 @@ def test_rfc3339(): mdt2 = maya.MayaDT.from_rfc3339(out) assert mdt.epoch == mdt2.epoch + rfc3339 = maya.MayaDT.rfc3339(maya.when('2016-01-01T12:03:03Z')) + # it's important that the string has got a "max 1-digit millis" fragment + # as per https://tools.ietf.org/html/rfc3339#section-5.6 + assert rfc3339 == '2016-01-01T12:03:03.0Z' + @pytest.mark.usefixtures("frozen_now") def test_comparison_operations():