From: Darragh O'Reilly Date: Mon, 27 Jul 2015 11:23:19 +0000 (+0000) Subject: Fix dhcp autoschedule test assertion logic X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=7f152490bfe001ccef7b3d2815978853585dbea3;p=openstack-build%2Fneutron-build.git Fix dhcp autoschedule test assertion logic The functional test for auto_schedule_networks passes even if the method does nothing. This patch changes the test so it checks that each expected hosted network is in hosted_net_ids. Change-Id: I42130993b1af3f3d028e355d30322853453f064f Closes-Bug: #1478531 --- diff --git a/neutron/tests/functional/scheduler/test_dhcp_agent_scheduler.py b/neutron/tests/functional/scheduler/test_dhcp_agent_scheduler.py index 3d37b1941..0cce1fceb 100644 --- a/neutron/tests/functional/scheduler/test_dhcp_agent_scheduler.py +++ b/neutron/tests/functional/scheduler/test_dhcp_agent_scheduler.py @@ -391,9 +391,7 @@ class TestAutoSchedule(test_dhcp_sch.TestDhcpSchedulerBaseTestCase, for net in hosted_networks] expected_hosted_networks = self.expected_hosted_networks['agent-%s' % host_index] - for hosted_net_id in hosted_net_ids: - self.assertIn(hosted_net_id, expected_hosted_networks, - message=msg + '[%s]' % hosted_net_id) + self.assertItemsEqual(hosted_net_ids, expected_hosted_networks, msg) def test_auto_schedule(self): for i in range(self.agent_count):