Skip to content

Commit

Permalink
Add isodate ending with Z to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dalito committed Jan 9, 2025
1 parent ad74966 commit 37d15f6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_utils/test_metamodelcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
Expand All @@ -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()
Expand Down

0 comments on commit 37d15f6

Please sign in to comment.