本文整理汇总了Python中neutronclient.neutron.v2_0.securitygroup._get_protocol_port函数的典型用法代码示例。如果您正苦于以下问题:Python _get_protocol_port函数的具体用法?Python _get_protocol_port怎么用?Python _get_protocol_port使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_get_protocol_port函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test__get_protocol_port_udp_code_type
def test__get_protocol_port_udp_code_type(self):
sg_rule = self._prepare_rule(protocol="icmp", port_range_min=1, port_range_max=8)
self.assertEqual("icmp (type:1, code:8)", securitygroup._get_protocol_port(sg_rule))
示例2: test__get_protocol_port_udp_port_range
def test__get_protocol_port_udp_port_range(self):
sg_rule = self._prepare_rule(protocol="udp", port_range_min=5000, port_range_max=5010)
self.assertEqual("5000-5010/udp", securitygroup._get_protocol_port(sg_rule))
示例3: test__get_protocol_port_icmp_all
def test__get_protocol_port_icmp_all(self):
sg_rule = self._prepare_rule(protocol="icmp")
self.assertEqual("icmp", securitygroup._get_protocol_port(sg_rule))
示例4: test__get_protocol_port_udp_one_port
def test__get_protocol_port_udp_one_port(self):
sg_rule = self._prepare_rule(protocol="udp", port_range_min=22, port_range_max=22)
self.assertEqual("22/udp", securitygroup._get_protocol_port(sg_rule))
示例5: test__get_protocol_port_all_none
def test__get_protocol_port_all_none(self):
sg_rule = self._prepare_rule()
self.assertIsNone(securitygroup._get_protocol_port(sg_rule))
示例6: test__get_protocol_port_udp_all_port
def test__get_protocol_port_udp_all_port(self):
sg_rule = self._prepare_rule(protocol='udp')
self.assertEqual('udp', securitygroup._get_protocol_port(sg_rule))
示例7: test__get_protocol_port_tcp_port_range
def test__get_protocol_port_tcp_port_range(self):
sg_rule = self._prepare_rule(protocol='tcp',
port_range_min=5000, port_range_max=5010)
self.assertEqual('5000-5010/tcp',
securitygroup._get_protocol_port(sg_rule))
示例8: test__get_protocol_port_tcp_one_port
def test__get_protocol_port_tcp_one_port(self):
sg_rule = self._prepare_rule(protocol='tcp',
port_range_min=22, port_range_max=22)
self.assertEqual('22/tcp', securitygroup._get_protocol_port(sg_rule))