

def test_servers(self):
    geturls = (lambda servers: [server.geturl() for server in servers])
    es = ES('127.0.0.1:9200')
    self.assertEqual(geturls(es.servers), ['http://127.0.0.1:9200'])
    es = ES('127.0.0.1:9500')
    self.assertEqual(geturls(es.servers), ['thrift://127.0.0.1:9500'])
    es = ES(('http', '127.0.0.1', 9400))
    self.assertEqual(geturls(es.servers), ['http://127.0.0.1:9400'])
    es = ES(('thrift', '127.0.0.1', 9100))
    self.assertEqual(geturls(es.servers), ['thrift://127.0.0.1:9100'])
    es = ES(['http://127.0.0.1:9100', '127.0.0.1:9200', ('thrift', '127.0.0.1', 9000), '127.0.0.1:9500'])
    self.assertEqual(geturls(sorted(es.servers)), ['http://127.0.0.1:9100', 'http://127.0.0.1:9200', 'thrift://127.0.0.1:9000', 'thrift://127.0.0.1:9500'])

dataset/ETHPy150Open aparo/pyes/tests/test_utils.py UtilsTestCase.test_servers/original