|
|
@@ -545,6 +545,7 @@ class FileObject(MDBase): |
|
|
|
|
|
|
|
_class_instance_properties = { |
|
|
|
'hostid': _makeuuid, |
|
|
|
'id': _makeuuid, |
|
|
|
} |
|
|
|
|
|
|
|
@staticmethod |
|
|
@@ -872,6 +873,9 @@ class _TestCases(unittest.TestCase): |
|
|
|
# make sure the file's hostid is a UUID |
|
|
|
self.assertIsInstance(a.hostid, uuid.UUID) |
|
|
|
|
|
|
|
# make sure the file's id is a UUID |
|
|
|
self.assertIsInstance(a.id, uuid.UUID) |
|
|
|
|
|
|
|
objst.loadobj(a) |
|
|
|
|
|
|
|
# write out the store |
|
|
@@ -885,6 +889,9 @@ class _TestCases(unittest.TestCase): |
|
|
|
# make sure the hostid is still a UUID |
|
|
|
self.assertIsInstance(a.hostid, uuid.UUID) |
|
|
|
|
|
|
|
# make sure the file's id is still a UUID |
|
|
|
self.assertIsInstance(a.id, uuid.UUID) |
|
|
|
|
|
|
|
def test_mdbase(self): |
|
|
|
self.assertRaises(ValueError, MDBase, created_by_ref='') |
|
|
|
self.assertRaises(ValueError, MDBase.create_obj, { 'type': 'unknosldkfj' }) |
|
|
|