Example #1
0
 def testMultiHost(self):
     info = self.cluster_info
     cs = ConnectionString(self.make_connargs()['connection_string'])
     cs.hosts = [info.host + ':' + '10', info.host + ':' + str(info.port)]
     cb = self.make_connection(connection_string=cs.encode())
     d = cb.connect()
     d.addCallback(lambda x: self.assertTrue(cb.connected))
     return d
 def testMultiHost(self):
     info = self.cluster_info
     cs = ConnectionString(self.make_connargs()['connection_string'])
     cs.hosts = [ info.host + ':' + '10', info.host + ':' + str(info.port) ]
     cb = self.make_connection(connection_string=cs.encode())
     d = cb.connect()
     d.addCallback(lambda x: self.assertTrue(cb.connected))
     return d
Example #3
0
    def test_server_not_found(self):
        connargs = self.make_connargs()
        cs = ConnectionString(connargs['connection_string'])
        cs.hosts = [ 'example.com' ]
        connargs['connection_string'] = cs.encode()
        self.assertRaises((CouchbaseNetworkError, TimeoutError),
            self.factory, **connargs)

        cs.hosts = [ self.cluster_info.host + ':' + str(34567)]
        self.assertRaises(CouchbaseNetworkError, self.factory, **connargs)