Browse Source

forgot the fileobject's id (host+dir+filename)

main
John-Mark Gurney 2 years ago
parent
commit
d2895ce7fa
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      ui/medashare/cli.py

+ 7
- 0
ui/medashare/cli.py View File

@@ -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' })


Loading…
Cancel
Save