本文整理汇总了Python中keywords.MobileRestClient.MobileRestClient.get_server_platform方法的典型用法代码示例。如果您正苦于以下问题:Python MobileRestClient.get_server_platform方法的具体用法?Python MobileRestClient.get_server_platform怎么用?Python MobileRestClient.get_server_platform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类keywords.MobileRestClient.MobileRestClient
的用法示例。
在下文中一共展示了MobileRestClient.get_server_platform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_longpoll_changes_termination_heartbeat
# 需要导入模块: from keywords.MobileRestClient import MobileRestClient [as 别名]
# 或者: from keywords.MobileRestClient.MobileRestClient import get_server_platform [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)