本文整理匯總了Python中cyder.cydhcp.network.models.Network.network_str方法的典型用法代碼示例。如果您正苦於以下問題:Python Network.network_str方法的具體用法?Python Network.network_str怎麽用?Python Network.network_str使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cyder.cydhcp.network.models.Network
的用法示例。
在下文中一共展示了Network.network_str方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_check_valid_ranges_v4_valid
# 需要導入模塊: from cyder.cydhcp.network.models import Network [as 別名]
# 或者: from cyder.cydhcp.network.models.Network import network_str [as 別名]
def test_check_valid_ranges_v4_valid(self):
n = Network(network_str='10.0.0.0/8')
n.full_clean()
n.save()
r = Range(ip_type='4', start_str='10.4.0.2', end_str='10.4.255.254',
network=n)
r.full_clean()
r.save()
n.network_str = '10.4.0.0/16'
n.full_clean()
n.save()
示例2: test_check_valid_ranges_v4_start_low_end_high
# 需要導入模塊: from cyder.cydhcp.network.models import Network [as 別名]
# 或者: from cyder.cydhcp.network.models.Network import network_str [as 別名]
def test_check_valid_ranges_v4_start_low_end_high(self):
n = Network(network_str='10.0.0.0/8')
n.full_clean()
n.save()
r = Range(ip_type='4', start_str='10.3.0.2', end_str='10.5.255.254',
network=n)
r.full_clean()
r.save()
n.network_str = '10.4.0.0/16'
with self.assertRaises(ValidationError):
n.full_clean()
n.save()