Revision eb5f7eb0 snf-cyclades-app/synnefo/api/tests/subnets.py

b/snf-cyclades-app/synnefo/api/tests/subnets.py
250 250
                             json.dumps(request), "json")
251 251
        self.assertConflict(response)
252 252

  
253
    def test_create_subnet_with_gateway_as_the_last_ip_of_subnet(self):
254
        """Test create a subnet with a gateway, as the last IP of the subnet"""
255
        test_net = mf.NetworkFactory()
256
        request = {
257
            'subnet': {
258
                'network_id': test_net.id,
259
                'cidr': '10.0.3.0/24',
260
                'ip_version': 4,
261
                'gateway_ip': 10.0.3.254}
262
        }
263
        response = self.post(SUBNETS_URL, test_net.userid,
264
                             json.dumps(request), "json")
265
        self.assertSuccess(response)
266
        resp = json.loads(response.content)['subnet']
267
        self.assertEqual("10.0.3.254", resp['gateway_ip'])
268
        self.assertEqual([{"start": "10.0.3.1", "end": "10.0.3.253"}],
269
                         resp['allocation_pools'])
270

  
253 271
    def test_create_subnet_with_ip_pool_end_lower_than_start(self):
254 272
        """Test create a subnet with a pool where end is lower than start"""
255 273
        test_net = mf.NetworkFactory()

Also available in: Unified diff