]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix dhcp autoschedule test assertion logic
authorDarragh O'Reilly <darragh.oreilly@hp.com>
Mon, 27 Jul 2015 11:23:19 +0000 (11:23 +0000)
committerDarragh O'Reilly <darragh.oreilly@hp.com>
Mon, 27 Jul 2015 11:25:23 +0000 (11:25 +0000)
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

neutron/tests/functional/scheduler/test_dhcp_agent_scheduler.py

index 3d37b19411581c9a49c5a9866f95ac9d58dcee9c..0cce1fceb70025897c2eb5a8b970fef841cf0946 100644 (file)
@@ -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):