def test_bad_host(self): # admin connections don't really connect until an action is performed try: admin = Admin('username', 'password', host='127.0.0.1', port=1) self.assertRaises(NetworkError, admin.bucket_info, 'default') except NetworkError: pass
def test_bucket_param(self): admin = Admin('Administrator', 'password', host=self.cluster_info.host, port=self.cluster_info.port, bucket='default') self.assertIsNotNone(admin)
def test_connection_string_param(self): conn_str = 'http://{0}:{1}'.format(self.cluster_info.host, self.cluster_info.port) admin = Admin('Administrator', 'password', connection_string=conn_str) self.assertIsNotNone(admin)
def make_admin_connection(self): return Admin(self.admin_username, self.admin_password, self.host, self.port, ipv6=self.ipv6)