'Tests that a port can get address by updating fixed_ips'

def test_port_update_allocate_from_net_subnet(self):

    with self.network() as network:
        pass
    response = self._create_port(self.fmt, net_id=network['network']['id'], tenant_id=network['network']['tenant_id'], arg_list=(portbindings.HOST_ID,), **{portbindings.HOST_ID: 'fakehost'})
    port = self.deserialize(self.fmt, response)
    with self.subnet(network=network) as subnet:
        data = {'port': {'fixed_ips': [{'subnet_id': subnet['subnet']['id']}]}}
        port_id = port['port']['id']
        port_req = self.new_update_request('ports', data, port_id)
        response = port_req.get_response(self.api)
        res = self.deserialize(self.fmt, response)
    self.assertEqual(webob.exc.HTTPOk.code, response.status_int)
    self.assertEqual(1, len(res['port']['fixed_ips']))
    ip = res['port']['fixed_ips'][0]['ip_address']
    ip_net = netaddr.IPNetwork(subnet['subnet']['cidr'])
    self.assertIn(ip, ip_net)
