本文整理汇总了Python中neutronclient.v2_0.client.Client.update_firewall_policy方法的典型用法代码示例。如果您正苦于以下问题:Python Client.update_firewall_policy方法的具体用法?Python Client.update_firewall_policy怎么用?Python Client.update_firewall_policy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类neutronclient.v2_0.client.Client
的用法示例。
在下文中一共展示了Client.update_firewall_policy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_policy_update
# 需要导入模块: from neutronclient.v2_0.client import Client [as 别名]
# 或者: from neutronclient.v2_0.client.Client import update_firewall_policy [as 别名]
def test_policy_update(self):
policy = self.fw_policies.first()
policy_dict = self.api_fw_policies.first()
policy.name = 'new name'
policy.description = 'new desc'
policy.shared = True
policy.audited = False
policy_dict['name'] = 'new name'
policy_dict['description'] = 'new desc'
policy_dict['shared'] = True
policy_dict['audited'] = False
form_data = {'name': policy.name,
'description': policy.description,
'shared': policy.shared,
'audited': policy.audited
}
form_dict = {'firewall_policy': form_data}
ret_dict = {'firewall_policy': policy_dict}
neutronclient.update_firewall_policy(
policy.id, form_dict).AndReturn(ret_dict)
self.mox.ReplayAll()
ret_val = api.fwaas.policy_update(self.request,
policy.id, **form_data)
self.assertIsInstance(ret_val, api.fwaas.Policy)
self.assertEqual(policy.name, ret_val.name)
self.assertTrue(ret_val.id)
示例2: test_policy_update
# 需要导入模块: from neutronclient.v2_0.client import Client [as 别名]
# 或者: from neutronclient.v2_0.client.Client import update_firewall_policy [as 别名]
def test_policy_update(self):
policy = self.fw_policies.first()
policy_dict = self.api_fw_policies.first()
policy.name = "new name"
policy.description = "new desc"
policy.shared = True
policy.audited = False
policy_dict["name"] = "new name"
policy_dict["description"] = "new desc"
policy_dict["shared"] = True
policy_dict["audited"] = False
form_data = {
"name": policy.name,
"description": policy.description,
"shared": policy.shared,
"audited": policy.audited,
}
form_dict = {"firewall_policy": form_data}
ret_dict = {"firewall_policy": policy_dict}
neutronclient.update_firewall_policy(policy.id, form_dict).AndReturn(ret_dict)
self.mox.ReplayAll()
ret_val = api.fwaas.policy_update(self.request, policy.id, **form_data)
self.assertIsInstance(ret_val, api.fwaas.Policy)
self.assertEqual(policy.name, ret_val.name)
self.assertTrue(ret_val.id)