tests.py 文件源码

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

项目:mos-horizon 作者: Mirantis 项目源码 文件源码
def test_create_snapshot_get(self):
        volume = self.cinder_volumes.first()
        cinder.volume_get(IsA(http.HttpRequest), volume.id) \
            .AndReturn(volume)
        snapshot_used = len(self.cinder_volume_snapshots.list())
        usage_limit = {'maxTotalVolumeGigabytes': 250,
                       'gigabytesUsed': 20,
                       'snapshotsUsed': snapshot_used,
                       'maxTotalSnapshots': 6}
        quotas.tenant_limit_usages(IsA(http.HttpRequest)).\
            AndReturn(usage_limit)
        self.mox.ReplayAll()

        url = reverse('horizon:project:volumes:'
                      'volumes:create_snapshot', args=[volume.id])
        res = self.client.get(url)

        self.assertTemplateUsed(res, 'project/volumes/volumes/'
                                'create_snapshot.html')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号