test_inventory.py 文件源码

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

项目:zun 作者: openstack 项目源码 文件源码
def test_list_inventories(self):
        totals = []
        for i in range(1, 6):
            provider = utils.create_test_resource_provider(
                id=i,
                uuid=uuidutils.generate_uuid(),
                context=self.context)
            inventory = utils.create_test_inventory(
                id=i,
                resource_provider_id=provider.id,
                total=i,
                context=self.context)
            totals.append(inventory['total'])
        res = dbapi.list_inventories(self.context)
        res_totals = [r.total for r in res]
        self.assertEqual(sorted(totals), sorted(res_totals))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号