

def test_hosts_outside_availability_zone_are_not_shown(self):
    active_hosts = ['h1', 'h2', 'h3', 'h4', 'h5']
    az_hosts = ['h1', 'h2']
    all_hosts = [self._host(name) for name in active_hosts]
    hosts_in_az = [self._host(name) for name in 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_hosts_outside_availability_zone_are_not_shown/original