def test_create_basic(self):
     sot = snapshot.Snapshot(SNAPSHOT)
     self.assertEqual(SNAPSHOT["id"], sot.id)
     self.assertEqual(SNAPSHOT["status"], sot.status)
     self.assertEqual(SNAPSHOT["created_at"], sot.created_at)
     self.assertEqual(SNAPSHOT["metadata"], sot.metadata)
     self.assertEqual(SNAPSHOT["volume_id"], sot.volume)
     self.assertEqual(SNAPSHOT["size"], sot.size)
     self.assertEqual(SNAPSHOT["name"], sot.name)
Exemple #2
0
    def test_volume_create_snapshot_prop(self):
        self.proxy._create = mock.Mock()

        id1 = "12345"
        id2 = "67890"
        snap = snapshot.Snapshot({"id": id1})
        source = volume.Volume({"id": id2})
        self.proxy.create_volume(snapshot=snap, source_volume=source)

        kwargs = self.proxy._create.call_args[1]
        self.assertEqual({"snapshot": id1, "source_volume": id2}, kwargs)
 def test_create_basic(self):
     sot = snapshot.Snapshot(SNAPSHOT)
     self.assertEqual(SNAPSHOT["id"], sot.id)
     self.assertEqual(SNAPSHOT["status"], sot.status)
     dt = datetime.datetime(2015, 3, 9, 12, 14, 57, 233772).replace(
         tzinfo=None)
     self.assertEqual(dt, sot.created_at.replace(tzinfo=None))
     self.assertEqual(SNAPSHOT["metadata"], sot.metadata)
     self.assertEqual(SNAPSHOT["volume_id"], sot.volume_id)
     self.assertEqual(SNAPSHOT["size"], sot.size)
     self.assertEqual(SNAPSHOT["name"], sot.name)
     self.assertTrue(sot.is_forced)
 def test_basic(self):
     sot = snapshot.Snapshot(SNAPSHOT)
     self.assertEqual("snapshot", sot.resource_key)
     self.assertEqual("snapshots", sot.resources_key)
     self.assertEqual("id", sot.id_attribute)
     self.assertEqual("/snapshots", sot.base_path)
     self.assertEqual("volume", sot.service.service_type)
     self.assertTrue(sot.allow_update)
     self.assertTrue(sot.allow_create)
     self.assertTrue(sot.allow_retrieve)
     self.assertTrue(sot.allow_delete)
     self.assertFalse(sot.allow_list)
 def test_create_basic(self):
     sot = snapshot.Snapshot(**SNAPSHOT)
     self.assertEqual(SNAPSHOT["id"], sot.id)
     self.assertEqual(SNAPSHOT["status"], sot.status)
     self.assertEqual(SNAPSHOT["created_at"], sot.created_at)
     self.assertEqual(SNAPSHOT["metadata"], sot.metadata)
     self.assertEqual(SNAPSHOT["volume_id"], sot.volume_id)
     self.assertEqual(SNAPSHOT["size"], sot.size)
     self.assertEqual(SNAPSHOT["name"], sot.name)
     self.assertTrue(sot.is_forced)
     self.assertEqual(SNAPSHOT["updated_at"], sot.updated_at)
     self.assertEqual(SNAPSHOT["display_name"], sot.display_name)
     self.assertEqual(SNAPSHOT["display_description"], sot.display_description)
Exemple #6
0
    def test_basic(self):
        sot = snapshot.Snapshot(SNAPSHOT)
        self.assertEqual("snapshot", sot.resource_key)
        self.assertEqual("snapshots", sot.resources_key)
        self.assertEqual("/snapshots", sot.base_path)
        self.assertEqual("volume", sot.service.service_type)
        self.assertTrue(sot.allow_get)
        self.assertTrue(sot.allow_update)
        self.assertTrue(sot.allow_create)
        self.assertTrue(sot.allow_delete)
        self.assertTrue(sot.allow_list)

        self.assertDictEqual({"name": "name",
                              "status": "status",
                              "all_tenants": "all_tenants",
                              "volume_id": "volume_id",
                              "limit": "limit",
                              "marker": "marker"},
                             sot._query_mapping._mapping)