示例#1
0
 def test_subnet_request_with_range(self):
     allocation_pools = [netaddr.IPRange('1.2.3.4', '1.2.3.5'),
                         netaddr.IPRange('1.2.3.7', '1.2.3.9')]
     request = ipam_req.SubnetRequest(self.tenant_id,
                                  self.subnet_id,
                                  allocation_pools=allocation_pools)
     self.assertEqual(allocation_pools, request.allocation_pools)
示例#2
0
 def test_subnet_request(self):
     pool = ipam_req.SubnetRequest(self.tenant_id,
                               self.subnet_id)
     self.assertEqual(self.tenant_id, pool.tenant_id)
     self.assertEqual(self.subnet_id, pool.subnet_id)
     self.assertIsNone(pool.gateway_ip)
     self.assertIsNone(pool.allocation_pools)
示例#3
0
 def test_subnet_request_gateway(self):
     request = ipam_req.SubnetRequest(self.tenant_id,
                                      self.subnet_id,
                                      gateway_ip='1.2.3.1')
     self.assertEqual('1.2.3.1', str(request.gateway_ip))