From 3b44632042890a1b7497547b44c54fd1a3f7b8b7 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Fri, 21 Jun 2024 12:30:43 +0200 Subject: [PATCH] Improve test --- test/unit/connectors/OpenStack.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/unit/connectors/OpenStack.py b/test/unit/connectors/OpenStack.py index dadc9db2..692fc761 100644 --- a/test/unit/connectors/OpenStack.py +++ b/test/unit/connectors/OpenStack.py @@ -782,7 +782,11 @@ def test_60_finalize(self, sleep, get_driver): fip.get_node_id.return_value = node.id fip.ip_address = '158.42.1.1' fip.delete.return_value = True - driver.ex_list_floating_ips.return_value = [fip] + fip2 = MagicMock() + fip2.get_node_id.return_value = "2" + fip2.ip_address = '158.42.1.2' + fip2.delete.return_value = True + driver.ex_list_floating_ips.return_value = [fip, fip2] driver.ex_detach_floating_ip_from_node.return_value = True sg1 = MagicMock() @@ -836,6 +840,7 @@ def test_60_finalize(self, sleep, get_driver): self.assertEqual(driver.ex_delete_security_group.call_args_list[0][0][0], sg2) self.assertEqual(driver.ex_delete_security_group.call_args_list[1][0][0], sg1) self.assertEqual(fip.delete.call_args_list, [call()]) + self.assertEqual(fip2.delete.call_count, 0) self.assertEqual(driver.ex_detach_floating_ip_from_node.call_args_list[0][0], (node, fip)) vm.floating_ips = ['158.42.1.1']