'Ensure that duplicate hosts in the contact points are surfaced in the cluster metadata
@since 3.3
@jira_ticket PYTHON-103
@expected_result duplicate hosts aren\'t surfaced in cluster.metadata
@test_category connection'

@local
def test_host_duplication(self):

    cluster = Cluster(contact_points=['localhost', '127.0.0.1', 'localhost', 'localhost', 'localhost'], protocol_version=PROTOCOL_VERSION, connect_timeout=1)
    cluster.connect(wait_for_all_pools=True)
    self.assertEqual(len(cluster.metadata.all_hosts()), 3)
    cluster.shutdown()
    cluster = Cluster(contact_points=['127.0.0.1', 'localhost'], protocol_version=PROTOCOL_VERSION, connect_timeout=1)
    cluster.connect(wait_for_all_pools=True)
    self.assertEqual(len(cluster.metadata.all_hosts()), 3)
    cluster.shutdown()
