def test_basic(self):
     sot = volume.Volume(VOLUME)
     self.assertEqual("volume", sot.resource_key)
     self.assertEqual("volumes", sot.resources_key)
     self.assertEqual("id", sot.id_attribute)
     self.assertEqual("/volumes", sot.base_path)
     self.assertEqual("volume", sot.service.service_type)
     self.assertTrue(sot.allow_create)
     self.assertTrue(sot.allow_retrieve)
     self.assertTrue(sot.allow_delete)
     self.assertFalse(sot.allow_list)
 def test_create(self):
     sot = volume.Volume(VOLUME)
     self.assertEqual(VOLUME["id"], sot.id)
     self.assertEqual(VOLUME["status"], sot.status)
     self.assertEqual(VOLUME["attachments"], sot.attachments)
     self.assertEqual(VOLUME["availability_zone"], sot.availability_zone)
     self.assertEqual(VOLUME["bootable"], sot.bootable)
     self.assertEqual(VOLUME["created_at"], sot.created)
     self.assertEqual(VOLUME["description"], sot.description)
     self.assertEqual(VOLUME["volume_type"], sot.type)
     self.assertEqual(VOLUME["snapshot_id"], sot.snapshot)
     self.assertEqual(VOLUME["source_volid"], sot.source_volume)
     self.assertEqual(VOLUME["metadata"], sot.metadata)
     self.assertEqual(VOLUME["size"], sot.size)
Example #3
0
 def get_volume(self, **data):
     return volume.Volume(data).get(self.session)