From 37d15f68cff824b3a81f45ec84824e0e5f838771 Mon Sep 17 00:00:00 2001 From: David Linke Date: Thu, 9 Jan 2025 21:49:58 +0100 Subject: [PATCH] Add isodate ending with Z to tests --- tests/test_utils/test_metamodelcore.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_utils/test_metamodelcore.py b/tests/test_utils/test_metamodelcore.py index 1bc26739..f70b88d9 100644 --- a/tests/test_utils/test_metamodelcore.py +++ b/tests/test_utils/test_metamodelcore.py @@ -153,6 +153,7 @@ def test_time(self): XSDDate(datetime.datetime.now()) self.assertFalse(XSDTime.is_valid('Jan 12, 2019')) self.assertFalse(XSDTime.is_valid(datetime.datetime.now())) + self.assertFalse(XSDTime.is_valid("2019-07-06T17:22:39Z")) self.assertTrue(XSDTime.is_valid(v)) def test_date(self): @@ -168,6 +169,9 @@ def test_date(self): XSDDate('Jan 12, 2019') with self.assertRaises(ValueError): XSDDate(datetime.datetime.now()) + with self.assertRaises(ValueError): + XSDDate("2019-07-06T17:22:39Z") + lax() bv = XSDDate('Jan 12, 2019') self.assertEqual('Jan 12, 2019', bv) @@ -188,6 +192,7 @@ def test_datetime(self): vstr = str(Literal(v).value) self.assertEqual('2019-07-06 17:22:39.007300', vstr) # Note that this has no 'T' self.assertEqual('2019-07-06T17:22:39.007300', XSDDateTime(vstr)) + self.assertEqual('2019-07-06T17:22:39+00:00', XSDDateTime("2019-07-06T17:22:39Z")) with self.assertRaises(ValueError): XSDDateTime('Jan 12, 2019') lax()