tests.py (horizon-18.6.2) | : | tests.py (horizon-18.6.3) | ||
---|---|---|---|---|
skipping to change at line 140 | skipping to change at line 140 | |||
if not fip.port_id][0] | if not fip.port_id][0] | |||
compute_port = self._get_compute_ports()[0] | compute_port = self._get_compute_ports()[0] | |||
port_target_id = self._get_target_id(compute_port) | port_target_id = self._get_target_id(compute_port) | |||
self.mock_tenant_floating_ip_list.return_value = \ | self.mock_tenant_floating_ip_list.return_value = \ | |||
self.floating_ips.list() | self.floating_ips.list() | |||
self.mock_floating_ip_target_list.return_value = \ | self.mock_floating_ip_target_list.return_value = \ | |||
self._get_fip_targets() | self._get_fip_targets() | |||
self.mock_floating_ip_associate.return_value = None | self.mock_floating_ip_associate.return_value = None | |||
form_data = {'instance_id': port_target_id, | form_data = {'port_id': port_target_id, | |||
'ip_id': floating_ip.id} | 'ip_id': floating_ip.id} | |||
url = reverse('%s:associate' % NAMESPACE) | url = reverse('%s:associate' % NAMESPACE) | |||
res = self.client.post(url, form_data) | res = self.client.post(url, form_data) | |||
self.assertRedirectsNoFollow(res, INDEX_URL) | self.assertRedirectsNoFollow(res, INDEX_URL) | |||
self.mock_tenant_floating_ip_list.assert_called_once_with( | self.mock_tenant_floating_ip_list.assert_called_once_with( | |||
test.IsHttpRequest()) | test.IsHttpRequest()) | |||
self.mock_floating_ip_target_list.assert_called_once_with( | self.mock_floating_ip_target_list.assert_called_once_with( | |||
test.IsHttpRequest()) | test.IsHttpRequest()) | |||
self.mock_floating_ip_associate.assert_called_once_with( | self.mock_floating_ip_associate.assert_called_once_with( | |||
skipping to change at line 169 | skipping to change at line 169 | |||
compute_port = self._get_compute_ports()[0] | compute_port = self._get_compute_ports()[0] | |||
port_target_id = self._get_target_id(compute_port) | port_target_id = self._get_target_id(compute_port) | |||
self.mock_tenant_floating_ip_list.return_value = \ | self.mock_tenant_floating_ip_list.return_value = \ | |||
self.floating_ips.list() | self.floating_ips.list() | |||
self.mock_floating_ip_target_list.return_value = \ | self.mock_floating_ip_target_list.return_value = \ | |||
self._get_fip_targets() | self._get_fip_targets() | |||
self.mock_floating_ip_associate.return_value = None | self.mock_floating_ip_associate.return_value = None | |||
next = reverse("horizon:project:instances:index") | next = reverse("horizon:project:instances:index") | |||
form_data = {'instance_id': port_target_id, | form_data = {'port_id': port_target_id, | |||
'next': next, | 'next': next, | |||
'ip_id': floating_ip.id} | 'ip_id': floating_ip.id} | |||
url = reverse('%s:associate' % NAMESPACE) | url = reverse('%s:associate' % NAMESPACE) | |||
res = self.client.post(url, form_data) | res = self.client.post(url, form_data) | |||
self.assertRedirectsNoFollow(res, next) | self.assertRedirectsNoFollow(res, next) | |||
self.mock_tenant_floating_ip_list.assert_called_once_with( | self.mock_tenant_floating_ip_list.assert_called_once_with( | |||
test.IsHttpRequest()) | test.IsHttpRequest()) | |||
self.mock_floating_ip_target_list.assert_called_once_with( | self.mock_floating_ip_target_list.assert_called_once_with( | |||
test.IsHttpRequest()) | test.IsHttpRequest()) | |||
skipping to change at line 198 | skipping to change at line 198 | |||
if not fip.port_id][0] | if not fip.port_id][0] | |||
compute_port = self._get_compute_ports()[0] | compute_port = self._get_compute_ports()[0] | |||
port_target_id = self._get_target_id(compute_port) | port_target_id = self._get_target_id(compute_port) | |||
self.mock_tenant_floating_ip_list.return_value = \ | self.mock_tenant_floating_ip_list.return_value = \ | |||
self.floating_ips.list() | self.floating_ips.list() | |||
self.mock_floating_ip_target_list.return_value = \ | self.mock_floating_ip_target_list.return_value = \ | |||
self._get_fip_targets() | self._get_fip_targets() | |||
self.mock_floating_ip_associate.side_effect = self.exceptions.nova | self.mock_floating_ip_associate.side_effect = self.exceptions.nova | |||
form_data = {'instance_id': port_target_id, | form_data = {'port_id': port_target_id, | |||
'ip_id': floating_ip.id} | 'ip_id': floating_ip.id} | |||
url = reverse('%s:associate' % NAMESPACE) | url = reverse('%s:associate' % NAMESPACE) | |||
res = self.client.post(url, form_data) | res = self.client.post(url, form_data) | |||
self.assertRedirectsNoFollow(res, INDEX_URL) | self.assertRedirectsNoFollow(res, INDEX_URL) | |||
self.mock_tenant_floating_ip_list.assert_called_once_with( | self.mock_tenant_floating_ip_list.assert_called_once_with( | |||
test.IsHttpRequest()) | test.IsHttpRequest()) | |||
self.mock_floating_ip_target_list.assert_called_once_with( | self.mock_floating_ip_target_list.assert_called_once_with( | |||
test.IsHttpRequest()) | test.IsHttpRequest()) | |||
self.mock_floating_ip_associate.assert_called_once_with( | self.mock_floating_ip_associate.assert_called_once_with( | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added |