本文整理汇总了Python中IPy._prefixlenToNetmask方法的典型用法代码示例。如果您正苦于以下问题:Python IPy._prefixlenToNetmask方法的具体用法?Python IPy._prefixlenToNetmask怎么用?Python IPy._prefixlenToNetmask使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPy
的用法示例。
在下文中一共展示了IPy._prefixlenToNetmask方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testKnownValuesv6p2n
# 需要导入模块: import IPy [as 别名]
# 或者: from IPy import _prefixlenToNetmask [as 别名]
def testKnownValuesv6p2n(self):
"""conversion of known values values should give known results"""
for x in self.known6Values:
(answer, question) = x
result = IPy._prefixlenToNetmask(question, 6)
self.assertEqual(answer, result, "%d: %s != %s" % (question, hex(answer), result))
示例2: testKnownValuesv4p2n
# 需要导入模块: import IPy [as 别名]
# 或者: from IPy import _prefixlenToNetmask [as 别名]
def testKnownValuesv4p2n(self):
"""conversion of known values values should give known results"""
for x in self.known4Values:
(answer, question) = x
result = IPy._prefixlenToNetmask(question, 4)
self.assertEqual(answer, result, hex(question))