'Test duplicate RPC addresses.
Modifies the system.peers table to make hosts have the same rpc address. Ensures such hosts are filtered out and a message is logged
@since 3.4
@jira_ticket PYTHON-366
@expected_result only one hosts\' metadata will be populated
@test_category metadata'

def test_duplicate(self):

    mock_handler = MockLoggingHandler()
    logger = logging.getLogger(cassandra.cluster.__name__)
    logger.addHandler(mock_handler)
    test_cluster = Cluster(protocol_version=PROTOCOL_VERSION, load_balancing_policy=self.load_balancing_policy)
    test_cluster.connect()
    warnings = mock_handler.messages.get('warning')
    self.assertEqual(len(warnings), 1)
    self.assertTrue(('multiple' in warnings[0]))
    logger.removeHandler(mock_handler)
    test_cluster.shutdown()
