horizon/openstack_dashboard/dashboards/project
Akihiro Motoki 516e57bc89 Add UT coverage for attach_interface by port
Previously attach_interface tests in project/instances/tests.py
did not cover the case of attach_interface by port.
This commit adds UT for such cases.

Details:
- The second call of the mocked network_list_for_tenant retured
  an empty list. It sounds tricky to change the return value for
  network_list_for_tenant() in two calls, but this trick was used
  to skip the processing of port_field_data.
  This should return a same value for the two calls to test
  port_field_data() function.
- To test the behavior of attach_interface by "port",
  an unbound port (whose device_owner/device_id of the port is empty)
  is required, so this commit adds it to neutron_data.py.
- test_interface_attach_get() covers a list of choices when "By Port"
  is selected in the form.
- test_interface_attach_post_by_port() is added.

Related to the addition of an unbound port to neutron_data.py,
the following other tests are adjusted.
They assumed that all non-network ports are owned by servers,
but it is no longer true as an unbound port is added to the test data.
Note that associating an unbound port with a floating IP is a valid
operation in neutron, so there is no problem to adjust UTs.

- openstack_dashboard/dashboards/project/floating_ips/tests.py
- openstack_dashboard/test/unit/api/test_neutron.py

Related-Bug: #1943639
Change-Id: Ib0ee342463e5668858078db43c04fe0a1be6e995
2022-10-26 15:34:17 -05:00
..
api_access Address RemovedInDjango40Warning (3) 2022-02-04 16:26:54 +09:00
backups Merge "volume-backup add incremental flag" 2022-09-20 06:43:09 +00:00
containers Address RemovedInDjango40Warning (3) 2022-02-04 16:26:54 +09:00
floating_ips Add UT coverage for attach_interface by port 2022-10-26 15:34:17 -05:00
images Deprecate Django based Panel for Images, Keypair, and roles 2022-05-10 05:28:28 +09:00
instances Add UT coverage for attach_interface by port 2022-10-26 15:34:17 -05:00
key_pairs Deprecate Django based Panel for Images, Keypair, and roles 2022-05-10 05:28:28 +09:00
network_qos Address RemovedInDjango40Warning (3) 2022-02-04 16:26:54 +09:00
network_topology Merge "Bugfix: Add missing closing </div> tags to network topology" 2022-08-22 15:03:05 +00:00
networks Merge "Don't try and update port security if its not changing" 2022-09-20 17:43:01 +00:00
overview Address RemovedInDjango40Warning (3) 2022-02-04 16:26:54 +09:00
routers Merge "Address RemovedInDjango40Warning (3)" 2022-03-10 12:23:11 +00:00
security_groups Address RemovedInDjango40Warning (3) 2022-02-04 16:26:54 +09:00
server_groups Address RemovedInDjango40Warning (3) 2022-02-04 16:26:54 +09:00
snapshots Fix success_url parameter issue for Edit Snapshot 2022-09-14 22:23:27 +05:30
static/dashboard/project Handle empty image_type in launch-instance workflow 2022-10-20 10:33:28 +02:00
trunks Address RemovedInDjango40Warning (3) 2022-02-04 16:26:54 +09:00
vg_snapshots Address RemovedInDjango40Warning (3) 2022-02-04 16:26:54 +09:00
volume_groups Address RemovedInDjango40Warning (4) 2022-02-04 16:27:18 +09:00
volumes Merge "Allow volumes in error_restoring/error_managing to be deleted" 2022-09-19 22:59:07 +00:00
__init__.py Splits OpenStack Dashboard bits from framework app code. 2012-10-11 11:47:50 -07:00
dashboard.py Address RemovedInDjango40Warning (2) 2022-02-04 16:22:07 +09:00