

def test_disabled_hosts_from_availability_zone_are_not_shown(self):
    active_hosts = ['h1', 'h2', 'h3', 'h4', 'h5']
    out_az_disabled_hosts = ['disabled1', 'disabled2', 'disabled3']
    disabled_az_hosts = ['az_disabled1', 'az_disabled2']
    disabled_hosts = (out_az_disabled_hosts + disabled_az_hosts)
    enabled_az_hosts = ['h1', 'h2']
    az_hosts = enabled_az_hosts
    all_hosts = [self._host(name) for name in active_hosts]
    all_hosts += [self._host(name, enabled=False) for name in disabled_hosts]
    hosts_in_az = ([self._host(name) for name in az_hosts] + [self._host(name, enabled=False) for name in disabled_az_hosts])
    self.mock_client().services.list.return_value = all_hosts
    self.mock_client().hosts.list.return_value = hosts_in_az
    hosts = self.nova_client.get_compute_hosts(availability_zone='az')
    self.assertEqual(az_hosts, hosts)

dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/tests/lib/os/compute/test_nova.py ComputeHostsTestCase.test_disabled_hosts_from_availability_zone_are_not_shown/original