def test_create_annotations(self): handler = ResourcePoolHandler(factory.make_admin(), {}, None) result = handler.create( {'name': factory.make_name('pool'), 'description': factory.make_name('description')}) self.assertEqual(0, result['machine_total_count']) self.assertEqual(0, result['machine_ready_count'])
def test_create_annotations(self): handler = ResourcePoolHandler(factory.make_admin(), {}, None) result = handler.create({ "name": factory.make_name("pool"), "description": factory.make_name("description"), }) self.assertEqual(0, result["machine_total_count"]) self.assertEqual(0, result["machine_ready_count"])
def test_create_rbac(self): self.enable_rbac() user = factory.make_User() self.rbac_store.allow(user.username, ALL_RESOURCES, 'view') self.rbac_store.allow(user.username, ALL_RESOURCES, 'edit') handler = ResourcePoolHandler(user, {}, None) result = handler.create( {'name': factory.make_name('pool'), 'description': factory.make_name('description')}) self.assertEqual(0, result['machine_total_count']) self.assertEqual(0, result['machine_ready_count'])
def test_create_rbac(self): self.enable_rbac() user = factory.make_User() self.rbac_store.allow(user.username, ALL_RESOURCES, "view") self.rbac_store.allow(user.username, ALL_RESOURCES, "edit") handler = ResourcePoolHandler(user, {}, None) result = handler.create({ "name": factory.make_name("pool"), "description": factory.make_name("description"), }) self.assertEqual(0, result["machine_total_count"]) self.assertEqual(0, result["machine_ready_count"])