'PYTHON-572'

def test_iterate_all_hosts_and_modify(self):

    metadata = Metadata()
    metadata.add_or_return_host(Host('dc1.1', SimpleConvictionPolicy))
    metadata.add_or_return_host(Host('dc1.2', SimpleConvictionPolicy))
    self.assertEqual(len(metadata.all_hosts()), 2)
    for host in metadata.all_hosts():
        metadata.remove_host(host)
    self.assertEqual(len(metadata.all_hosts()), 0)
