Skip to content

Commit 8cfa8de

Browse files
committed
Add isodate ending with Z to tests
1 parent ad74966 commit 8cfa8de

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.github/workflows/main.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
python-version: "3.8"
1919

2020
runs-on: ${{ matrix.os }}
21-
21+
2222
steps:
2323

2424
#----------------------------------------------
@@ -49,6 +49,7 @@ jobs:
4949
# coverage report
5050
#----------------------------------------------
5151
- name: Generate coverage results
52+
shell: bash
5253
run: |
5354
poetry run coverage run -m pytest
5455
poetry run coverage xml

tests/test_utils/test_metamodelcore.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ def test_time(self):
153153
XSDDate(datetime.datetime.now())
154154
self.assertFalse(XSDTime.is_valid('Jan 12, 2019'))
155155
self.assertFalse(XSDTime.is_valid(datetime.datetime.now()))
156+
self.assertFalse(XSDTime.is_valid("2019-07-06T17:22:39Z"))
156157
self.assertTrue(XSDTime.is_valid(v))
157158

158159
def test_date(self):
@@ -168,6 +169,9 @@ def test_date(self):
168169
XSDDate('Jan 12, 2019')
169170
with self.assertRaises(ValueError):
170171
XSDDate(datetime.datetime.now())
172+
with self.assertRaises(ValueError):
173+
XSDDate("2019-07-06T17:22:39Z")
174+
171175
lax()
172176
bv = XSDDate('Jan 12, 2019')
173177
self.assertEqual('Jan 12, 2019', bv)
@@ -188,6 +192,7 @@ def test_datetime(self):
188192
vstr = str(Literal(v).value)
189193
self.assertEqual('2019-07-06 17:22:39.007300', vstr) # Note that this has no 'T'
190194
self.assertEqual('2019-07-06T17:22:39.007300', XSDDateTime(vstr))
195+
self.assertEqual('2019-07-06T17:22:39+00:00', XSDDateTime("2019-07-06T17:22:39Z"))
191196
with self.assertRaises(ValueError):
192197
XSDDateTime('Jan 12, 2019')
193198
lax()

0 commit comments

Comments
 (0)