def test_list_hosts(self): """Verify that the volume hosts are returned.""" hosts = os_hosts._list_hosts(self.req) self.assertEqual(hosts, LIST_RESPONSE) cinder_hosts = os_hosts._list_hosts(self.req, 'cinder-volume') expected = [host for host in LIST_RESPONSE if host['service'] == 'cinder-volume'] self.assertEqual(cinder_hosts, expected)
def test_list_hosts_with_zone(self): req = FakeRequestWithcinderZone() hosts = os_hosts._list_hosts(req) self.assertEqual(hosts, LIST_RESPONSE)