本文整理汇总了Python中keywords.MobileRestClient.MobileRestClient.delete_databases方法的典型用法代码示例。如果您正苦于以下问题:Python MobileRestClient.delete_databases方法的具体用法?Python MobileRestClient.delete_databases怎么用?Python MobileRestClient.delete_databases使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类keywords.MobileRestClient.MobileRestClient
的用法示例。
在下文中一共展示了MobileRestClient.delete_databases方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_p2p_test
# 需要导入模块: from keywords.MobileRestClient import MobileRestClient [as 别名]
# 或者: from keywords.MobileRestClient.MobileRestClient import delete_databases [as 别名]
def setup_p2p_test(request, setup_p2p_suite):
"""Test setup fixture for p2p client tests"""
log_info("Setting up P2P test ...")
liteserv_one = setup_p2p_suite["liteserv_one"]
liteserv_two = setup_p2p_suite["liteserv_two"]
test_name = request.node.name
print("Starting LiteServ One ...")
ls_logging_one = "{}/logs/{}-ls1-{}-{}.txt".format(RESULTS_DIR, type(liteserv_one).__name__, test_name, datetime.datetime.now())
ls_url_one = liteserv_one.start(ls_logging_one)
print("Starting LiteServ Two ...")
ls_logging_two = "{}/logs/{}-ls2-{}-{}.txt".format(RESULTS_DIR, type(liteserv_two).__name__, test_name, datetime.datetime.now())
ls_url_two = liteserv_two.start(ls_logging_two)
# Yield values to test case via fixture argument
yield {"ls_url_one": ls_url_one, "ls_url_two": ls_url_two}
log_info("Tearing down test")
# Teardown test
client = MobileRestClient()
client.delete_databases(ls_url_one)
client.delete_databases(ls_url_two)
liteserv_one.stop()
liteserv_two.stop()
示例2: test_ios_full_life_cycle
# 需要导入模块: from keywords.MobileRestClient import MobileRestClient [as 别名]
# 或者: from keywords.MobileRestClient.MobileRestClient import delete_databases [as 别名]
def test_ios_full_life_cycle(request, liteserv_with_storage_engine_from_fixture):
liteserv = liteserv_with_storage_engine_from_fixture
test_name = request.node.name
logfile = "{}/logs/{}-{}-{}.txt".format(RESULTS_DIR, type(liteserv).__name__, test_name, datetime.datetime.now())
ls_url = liteserv.start(logfile)
client = MobileRestClient()
client.create_database(ls_url, "ls_db")
docs = client.add_docs(ls_url, db="ls_db", number=10, id_prefix="test_doc")
assert len(docs) == 10
client.delete_databases(ls_url)
liteserv.stop()
示例3: setup_client_syncgateway_test
# 需要导入模块: from keywords.MobileRestClient import MobileRestClient [as 别名]
# 或者: from keywords.MobileRestClient.MobileRestClient import delete_databases [as 别名]
def setup_client_syncgateway_test(request, setup_client_syncgateway_suite):
"""Test setup fixture for client sync_gateway tests"""
log_info("Setting up client sync_gateway test ...")
liteserv = setup_client_syncgateway_suite
test_name = request.node.name
ls_url = liteserv.start(
"{}/logs/{}-{}-{}.txt".format(RESULTS_DIR, type(liteserv).__name__, test_name, datetime.datetime.now())
)
cluster_helper = ClusterKeywords()
sg_helper = SyncGateway()
cluster_hosts = cluster_helper.get_cluster_topology(os.environ["CLUSTER_CONFIG"])
sg_url = cluster_hosts["sync_gateways"][0]["public"]
sg_admin_url = cluster_hosts["sync_gateways"][0]["admin"]
sg_helper.stop_sync_gateway(cluster_config=os.environ["CLUSTER_CONFIG"], url=sg_url)
# Yield values to test case via fixture argument
yield {
"cluster_config": os.environ["CLUSTER_CONFIG"],
"ls_url": ls_url,
"sg_url": sg_url,
"sg_admin_url": sg_admin_url,
}
log_info("Tearing down test")
# Teardown test
client = MobileRestClient()
client.delete_databases(ls_url)
liteserv.stop()
sg_helper.stop_sync_gateway(cluster_config=os.environ["CLUSTER_CONFIG"], url=sg_url)
# if the test failed pull logs
if request.node.rep_call.failed:
logging_helper = Logging()
logging_helper.fetch_and_analyze_logs(cluster_config=os.environ["CLUSTER_CONFIG"], test_name=test_name)
示例4: test_net_mono_storage_engine
# 需要导入模块: from keywords.MobileRestClient import MobileRestClient [as 别名]
# 或者: from keywords.MobileRestClient.MobileRestClient import delete_databases [as 别名]
def test_net_mono_storage_engine(request, liteserv_with_storage_engine_from_fixture):
liteserv = liteserv_with_storage_engine_from_fixture
test_name = request.node.name
logfile = "{}/logs/{}-{}-{}.txt".format(RESULTS_DIR, type(liteserv).__name__, test_name, datetime.datetime.now())
ls_url = liteserv.start(logfile)
client = MobileRestClient()
client.create_database(ls_url, "ls_db")
storage_engine = liteserv.storage_engine
log_info("Testing storage_engine: {}".format(storage_engine))
if storage_engine == "SQLite":
db_files = os.listdir("results/dbs/net-mono/ls_db.cblite2")
assert "db.sqlite3" in db_files
assert "db.sqlite3-shm" in db_files
assert "db.sqlite3-wal" in db_files
att_files = os.listdir("results/dbs/net-mono/ls_db.cblite2/attachments")
assert att_files == []
client.delete_databases(ls_url)
assert not os.path.isdir("results/dbs/net-mono/ls_db.cblite2/")
elif storage_engine == "SQLCipher":
db_files = os.listdir("results/dbs/net-mono/ls_db.cblite2")
assert "db.sqlite3" in db_files
assert "db.sqlite3-shm" in db_files
assert "db.sqlite3-wal" in db_files
att_files = os.listdir("results/dbs/net-mono/ls_db.cblite2/attachments")
assert att_files == ["_encryption"]
client.delete_databases(ls_url)
assert not os.path.isdir("results/dbs/net-mono/ls_db.cblite2/")
elif storage_engine == "ForestDB":
db_files = os.listdir("results/dbs/net-mono/ls_db.cblite2")
assert "db.forest.0" in db_files
assert "db.forest.meta" in db_files
att_files = os.listdir("results/dbs/net-mono/ls_db.cblite2/attachments")
assert att_files == []
client.delete_databases(ls_url)
assert not os.path.isdir("results/dbs/net-mono/ls_db.cblite2/")
elif storage_engine == "ForestDB+Encryption":
db_files = os.listdir("results/dbs/net-mono/ls_db.cblite2")
assert "db.forest.0" in db_files
assert "db.forest.meta" in db_files
att_files = os.listdir("results/dbs/net-mono/ls_db.cblite2/attachments")
assert att_files == ["_encryption"]
client.delete_databases(ls_url)
assert not os.path.isdir("results/dbs/net-mono/ls_db.cblite2/")
else:
pytest.xfail("Invalid Storage Engine")
liteserv.stop()
示例5: setup_client_2sgs_test
# 需要导入模块: from keywords.MobileRestClient import MobileRestClient [as 别名]
# 或者: from keywords.MobileRestClient.MobileRestClient import delete_databases [as 别名]
def setup_client_2sgs_test(request):
"""Test setup fixture for client sync_gateway tests"""
log_info("Setting up client sync_gateway test ...")
liteserv_platform = request.config.getoption("--liteserv-platform")
liteserv_version = request.config.getoption("--liteserv-version")
liteserv_host = request.config.getoption("--liteserv-host")
liteserv_port = request.config.getoption("--liteserv-port")
liteserv_storage_engine = request.config.getoption("--liteserv-storage-engine")
ls = LiteServ()
client = MobileRestClient()
test_name = request.node.name
# Verify LiteServ is not running
ls.verify_liteserv_not_running(host=liteserv_host, port=liteserv_port)
ls_cluster_target = None
if liteserv_platform == "net-win":
ls_cluster_target = "resources/cluster_configs/windows"
print("Starting LiteServ ...")
if liteserv_platform != "net-win":
# logging is file
ls_logging = open("{}/logs/{}-ls1-{}-{}.txt".format(RESULTS_DIR, datetime.datetime.now(), liteserv_platform, test_name), "w")
else:
# logging is name
ls_logging = "{}/logs/{}-ls1-{}-{}.txt".format(RESULTS_DIR, datetime.datetime.now(), liteserv_platform, test_name)
ls_url, ls_handle = ls.start_liteserv(
platform=liteserv_platform,
version=liteserv_version,
host=liteserv_host,
port=liteserv_port,
storage_engine=liteserv_storage_engine,
logfile=ls_logging,
cluster_config=ls_cluster_target
)
cluster_helper = ClusterKeywords()
sg_helper = SyncGateway()
cluster_hosts = cluster_helper.get_cluster_topology(os.environ["CLUSTER_CONFIG"])
sg_one_url = cluster_hosts["sync_gateways"][0]["public"]
sg_one_admin_url = cluster_hosts["sync_gateways"][0]["admin"]
sg_two_url = cluster_hosts["sync_gateways"][1]["public"]
sg_two_admin_url = cluster_hosts["sync_gateways"][1]["admin"]
sg_helper.stop_sync_gateway(cluster_config=os.environ["CLUSTER_CONFIG"], url=sg_one_url)
sg_helper.stop_sync_gateway(cluster_config=os.environ["CLUSTER_CONFIG"], url=sg_two_url)
# Yield values to test case via fixture argument
yield {
"cluster_config": os.environ["CLUSTER_CONFIG"],
"ls_url": ls_url,
"sg_one_url": sg_one_url,
"sg_one_admin_url": sg_one_admin_url,
"sg_two_url": sg_two_url,
"sg_two_admin_url": sg_two_admin_url
}
log_info("Tearing down test")
# Teardown test
client.delete_databases(ls_url)
ls.shutdown_liteserv(host=liteserv_host,
platform=liteserv_platform,
version=liteserv_version,
storage_engine=liteserv_storage_engine,
process_handle=ls_handle,
logfile=ls_logging,
cluster_config=ls_cluster_target)
# Verify LiteServ is killed
ls.verify_liteserv_not_running(host=liteserv_host, port=liteserv_port)
sg_helper.stop_sync_gateway(cluster_config=os.environ["CLUSTER_CONFIG"], url=sg_one_url)
sg_helper.stop_sync_gateway(cluster_config=os.environ["CLUSTER_CONFIG"], url=sg_two_url)
# if the test failed pull logs
if request.node.rep_call.failed:
logging_helper = Logging()
logging_helper.fetch_and_analyze_logs(cluster_config=os.environ["CLUSTER_CONFIG"], test_name=test_name)