'Update a port with existing IPs to a host where they don\'t work'

def test_port_update_fails_if_host_on_good_segment(self):

    (network, segments, subnets) = self._create_test_segments_with_subnets(2)
    self._setup_host_mappings([(segments[0]['segment']['id'], 'fakehost2'), (segments[1]['segment']['id'], 'fakehost1'), (segments[1]['segment']['id'], 'fakehost')])
    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'})
    self._assert_one_ip_in_subnet(response, subnets[1]['subnet']['cidr'])
    port = self.deserialize(self.fmt, response)
    data = {'port': {portbindings.HOST_ID: 'fakehost1'}}
    port_req = self.new_update_request('ports', data, port['port']['id'])
    response = port_req.get_response(self.api)
    self.assertEqual(webob.exc.HTTPOk.code, response.status_int)
