

@test.create_stubs({
    cinder: ('volume_cgroup_update', 'volume_cgroup_get'),
})
def test_update_cgroup_add_vol(self):
    cgroup = self.cinder_consistencygroups.first()
    volume = self.cinder_volumes.first()
    formData = {
        'volume_types': '1',
        'name': 'test CG',
        'description': 'test desc',
    }
    cinder.volume_cgroup_get(IsA(http.HttpRequest), cgroup.id).AndReturn(cgroup)
    cinder.volume_cgroup_update(IsA(http.HttpRequest), formData['name'], formData['description'], add_vols=volume).AndReturn(cgroup)
    self.mox.ReplayAll()
    url = reverse('horizon:project:volumes:cgroups:update', args=[cgroup.id])
    res = self.client.post(url, formData)
    self.assertNoFormErrors(res)

dataset/ETHPy150Open openstack/horizon/openstack_dashboard/dashboards/project/volumes/cgroups/tests.py ConsistencyGroupTests.test_update_cgroup_add_vol/original