Skip to content

Commit 83928bd

Browse files
authored
check times types (#201)
1 parent 015a602 commit 83928bd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

fs/test.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,16 @@ def test_getinfo(self):
483483
# Check a number of standard namespaces
484484
# FS objects may not support all these, but we can at least
485485
# invoke the code
486-
self.fs.getinfo("foo", namespaces=["access", "stat", "details"])
486+
info = self.fs.getinfo("foo", namespaces=["access", "stat", "details"])
487+
488+
# Check that if the details namespace is present, times are
489+
# of valid types.
490+
if 'details' in info.namespaces:
491+
details = info.raw['details']
492+
self.assertIsInstance(details.get('accessed'), (type(None), int, float))
493+
self.assertIsInstance(details.get('modified'), (type(None), int, float))
494+
self.assertIsInstance(details.get('created'), (type(None), int, float))
495+
self.assertIsInstance(details.get('metadata_changed'), (type(None), int, float))
487496

488497
def test_exists(self):
489498
# Test exists method.

0 commit comments

Comments
 (0)