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