Make sure the tests cover both ip and extIp
@@ -198,11 +198,16 @@ def test_doesnt_stop_itself(node_scenario):
mock_item.ip = "1.2.3.4"
mock_item2 = MagicMock()
mock_item2.extIp = "1.2.3.5"
- node_scenario.match = MagicMock(return_value=[mock_item, mock_item2])
+ mock_item3 = MagicMock()
+ mock_item3.ip = "1.2.3.5"
+ mock_item4 = MagicMock()
+ mock_item4.extIp = "1.2.3.4"
+ node_scenario.match = MagicMock(return_value=[mock_item, mock_item2, mock_item3, mock_item4])
node_scenario.act = MagicMock()
node_scenario.execute()
+ print(node_scenario.act.call_args_list)
assert node_scenario.act.call_count == 1
for _, call in enumerate(node_scenario.act.call_args_list):
args, kwargs = call
- assert args == ([mock_item2],)
+ assert args == ([mock_item2, mock_item3],)
assert kwargs == {}
