diff --git a/tests/tools/test_network_tools.py b/tests/tools/test_network_tools.py index c41f2e3..b3b6d8b 100644 --- a/tests/tools/test_network_tools.py +++ b/tests/tools/test_network_tools.py @@ -676,7 +676,7 @@ def test_add_port_fixed_ip(self, mock_openstack_connect_network): new_fixed = list(current.fixed_ips) new_fixed.append({"subnet_id": "subnet-2", "ip_address": "10.0.1.10"}) res = tools.update_port("port-1", fixed_ips=new_fixed) - assert len(res.fixed_ips or []) == 2 + assert len(res.fixed_ips) == 2 def test_remove_port_fixed_ip(self, mock_openstack_connect_network): mock_conn = mock_openstack_connect_network @@ -711,7 +711,7 @@ def test_remove_port_fixed_ip(self, mock_openstack_connect_network): fi for fi in current.fixed_ips if fi["ip_address"] != "10.0.1.10" ] res = tools.update_port("port-1", fixed_ips=filtered) - assert len(res.fixed_ips or []) == 1 + assert len(res.fixed_ips) == 1 def test_get_and_update_allowed_address_pairs( self, @@ -1289,6 +1289,7 @@ def test_update_reassign_bulk_and_auto_assign_floating_ip( mock_conn.network.create_ip.side_effect = [f1] bulk = tools.create_floating_ips_bulk("ext-net", 1) assert len(bulk) == 1 + assert bulk[0].id == f1.id exists = Mock() exists.id = "fip-b"