def test_disabled_down_hosts_are_skipped(self):
        active_host_names = ['active1', 'active2']
        disabled_host_names = ['disabled1', 'disabled2', 'disabled3']

        disabled_hosts = [self._host(name, enabled=False, up=False)
                          for name in disabled_host_names]
        active_hosts = [self._host(name) for name in active_host_names]
        all_hosts = active_hosts + disabled_hosts

        self.mock_client().services.list.return_value = all_hosts
        self.mock_client().hosts.list.return_value = all_hosts

        hosts = self.nova_client.get_compute_hosts()

        self.assertIsNotNone(hosts)
        self.assertTrue(isinstance(hosts, list))

        for active in active_host_names:
            self.assertIn(active, hosts)

        for disabled in disabled_host_names:
            self.assertNotIn(disabled, hosts)
dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/tests/lib/os/compute/test_nova.py/ComputeHostsTestCase.test_disabled_down_hosts_are_skipped/original