def setUp(self):
        super(TestSnapshotCreate, self).setUp()

        self.volumes_mock.get.return_value = fakes.FakeResource(
            None, copy.deepcopy(volume_fakes.VOLUME), loaded=True)

        self.snapshots_mock.create.return_value = fakes.FakeResource(
            None, copy.deepcopy(volume_fakes.SNAPSHOT), loaded=True)
        # Get the command object to test
        self.cmd = snapshot.CreateSnapshot(self.app, None)
示例#2
0
    def setUp(self):
        super(TestSnapshotCreate, self).setUp()

        self.volume = volume_fakes.FakeVolume.create_one_volume()
        self.new_snapshot = volume_fakes.FakeSnapshot.create_one_snapshot(
            attrs={'volume_id': self.volume.id})

        self.data = (
            self.new_snapshot.created_at,
            self.new_snapshot.description,
            self.new_snapshot.id,
            self.new_snapshot.name,
            utils.format_dict(self.new_snapshot.metadata),
            self.new_snapshot.size,
            self.new_snapshot.status,
            self.new_snapshot.volume_id,
        )

        self.volumes_mock.get.return_value = self.volume
        self.snapshots_mock.create.return_value = self.new_snapshot
        # Get the command object to test
        self.cmd = snapshot.CreateSnapshot(self.app, None)