Example #1
0
    def __init__(self, hosts=None, version="1.6", timeout=None,
                 client_builder=None):
        self.hosts = parse_hosts(hosts or ["localhost"])

        if client_builder is None:
            client_builder = Client
        self.c = client_builder(
            version, timeout, log=self.log, pool=self.pool)

        self.version = version
        self.timeout = timeout
Example #2
0
    def __init__(self,
                 hosts=None,
                 version="1.6",
                 timeout=None,
                 client_builder=None):
        self.hosts = parse_hosts(hosts or ["localhost"])

        if client_builder is None:
            client_builder = Client
        self.c = client_builder(version, timeout, log=self.log, pool=self.pool)

        self.version = version
        self.timeout = timeout
Example #3
0
 def test_parse_hosts_invalid(self):
     """Invalid hosts of all sorts should be handled corectly
     """
     self.assertEqual([], parse_hosts(None))
     self.assertEqual([], parse_hosts(""))
Example #4
0
 def test_parse_hosts_invalid(self):
     """Invalid hosts of all sorts should be handled corectly
     """
     self.assertEqual([], parse_hosts(None))
     self.assertEqual([], parse_hosts(""))