tests.py 文件源码

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

项目:mos-horizon 作者: Mirantis 项目源码 文件源码
def test_snapshots_tab(self):
        cinder.volume_snapshot_list_paged(
            IsA(http.HttpRequest), paginate=True, marker=None, sort_dir='desc',
            search_opts={'all_tenants': True},).AndReturn(
            [self.cinder_volume_snapshots.list(), False, False])
        cinder.volume_list(IsA(http.HttpRequest), search_opts={
            'all_tenants': True}).\
            AndReturn(self.cinder_volumes.list())
        keystone.tenant_list(IsA(http.HttpRequest)). \
            AndReturn([self.tenants.list(), False])

        self.mox.ReplayAll()
        url = reverse('horizon:admin:volumes:snapshots_tab')
        res = self.client.get(urlunquote(url))

        self.assertEqual(res.status_code, 200)
        self.assertTemplateUsed(res, 'admin/volumes/index.html')
        snapshots = res.context['volume_snapshots_table'].data
        self.assertItemsEqual(snapshots, self.cinder_volume_snapshots.list())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号