本文整理匯總了Python中keywords.MobileRestClient.MobileRestClient.get_databases方法的典型用法代碼示例。如果您正苦於以下問題:Python MobileRestClient.get_databases方法的具體用法?Python MobileRestClient.get_databases怎麽用?Python MobileRestClient.get_databases使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類keywords.MobileRestClient.MobileRestClient
的用法示例。
在下文中一共展示了MobileRestClient.get_databases方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_longpoll_changes_termination_heartbeat
# 需要導入模塊: from keywords.MobileRestClient import MobileRestClient [as 別名]
# 或者: from keywords.MobileRestClient.MobileRestClient import get_databases [as 別名]
def test_longpoll_changes_termination_heartbeat(setup_client_syncgateway_test):
"""https://github.com/couchbase/couchbase-lite-java-core/issues/1296
Create 30 longpoll _changes in a loop (with heartbeat parameter = 5s)
Cancel the request after 2s
Wait 5.1s
Create another request GET /db/ on listener and make sure the listener responds
"""
log_info("Running 'longpoll_changes_termination' ...")
ls_db = "ls_db"
cluster_config = setup_client_syncgateway_test["cluster_config"]
sg_url = setup_client_syncgateway_test["sg_url"]
ls_url = setup_client_syncgateway_test["ls_url"]
log_info("Running 'test_longpoll_changes_termination' ...")
log_info("ls_url: {}".format(ls_url))
log_info("sg_url: {}".format(sg_url))
sg_helper = SyncGateway()
sg_helper.start_sync_gateway(
cluster_config=cluster_config,
url=sg_url,
config="{}/walrus.json".format(SYNC_GATEWAY_CONFIGS)
)
client = MobileRestClient()
if client.get_server_platform(ls_url) == Platform.macosx:
pytest.skip("https://github.com/couchbase/couchbase-lite-ios/issues/1236")
client.create_database(ls_url, ls_db)
ct = ChangesTracker(ls_url, ls_db)
with ThreadPoolExecutor(max_workers=35) as executor:
futures = [executor.submit(
ct.start,
timeout=5000,
heartbeat=5000,
request_timeout=2000
) for _ in range(30)]
for futures in as_completed(futures):
log_info("Future _changes loop complete")
log_info("Futures exited")
# make sure client can still take connections
dbs = client.get_databases(url=ls_url)
log_info(dbs)
database = client.get_database(url=ls_url, db_name=ls_db)
log_info(database)