tests.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:mos-horizon 作者: Mirantis 项目源码 文件源码
def test_delete_cgroup(self):
        cgroups = self.cinder_consistencygroups.list()
        cgroup = self.cinder_consistencygroups.first()

        cinder.volume_cgroup_list_with_vol_type_names(IsA(http.HttpRequest)).\
            AndReturn(cgroups)
        cinder.volume_cgroup_delete(IsA(http.HttpRequest), cgroup.id,
                                    force=False)
        if django.VERSION < (1, 9):
            cinder.volume_cgroup_list_with_vol_type_names(
                IsA(http.HttpRequest)).AndReturn(cgroups)

        self.mox.ReplayAll()

        formData = {'action': 'volume_cgroups__deletecg__%s' % cgroup.id}
        res = self.client.post(VOLUME_CGROUPS_TAB_URL, formData, follow=True)
        self.assertIn("Scheduled deletion of Consistency Group: cg_1",
                      [m.message for m in res.context['messages']])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号