From d2895ce7fa1ea9275ee59ac3fb44696d3ecbcf93 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Mon, 15 Aug 2022 14:54:36 -0700 Subject: [PATCH] forgot the fileobject's id (host+dir+filename) --- ui/medashare/cli.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/medashare/cli.py b/ui/medashare/cli.py index c2607da..fa4617a 100644 --- a/ui/medashare/cli.py +++ b/ui/medashare/cli.py @@ -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' })