Skip to content

Commit

Permalink
Merge pull request #1578 from grycap/devel
Browse files Browse the repository at this point in the history
Improve test
  • Loading branch information
micafer authored Jun 26, 2024
2 parents 217fb60 + 3b44632 commit f745a0c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/unit/connectors/OpenStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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']
Expand Down

0 comments on commit f745a0c

Please sign in to comment.