コード例 #1
0
 def test_list(self):
     user = factory.make_User()
     handler = ResourcePoolHandler(user, {}, None)
     pool = factory.make_ResourcePool()
     returned_pool_names = [
         data['name'] for data in handler.list({})]
     self.assertEqual(['default', pool.name], returned_pool_names)
コード例 #2
0
 def test_list_rbac(self):
     self.enable_rbac()
     user = factory.make_User()
     handler = ResourcePoolHandler(user, {}, None)
     pool = factory.make_ResourcePool()
     self.rbac_store.add_pool(pool)
     self.rbac_store.allow(user.username, pool, "view")
     returned_pool_names = [data["name"] for data in handler.list({})]
     self.assertEqual([pool.name], returned_pool_names)