本文整理汇总了Python中test.log函数的典型用法代码示例。如果您正苦于以下问题:Python log函数的具体用法?Python log怎么用?Python log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了log函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_attachable_aut
def add_attachable_aut(name="teest",port=11233):
test.log("Adding attachable aut to autlist")
squish_module_helper.import_squish_symbols()
if sys.platform.startswith("win"):
subprocess.Popen([os.path.join(os.environ["SQUISH_PREFIX"], 'bin', 'squishserver.exe'), '--config', 'addAttachableAUT', name, str(port)])
else:
subprocess.Popen([os.path.join(os.environ["SQUISH_PREFIX"], 'bin', 'squishserver'), '--config', 'addAttachableAUT', name, str(port)])
示例2: get_delivery_config_get_url
def get_delivery_config_get_url(url):
test.log("get_delivery_config_get_url : " + url)
open = urllib2.urlopen(url)
dict = json.load(open)
#pprint(dict)
list_of_hubs = dict['availableHubs']
if(len(list_of_hubs) > 0):
for hub in list_of_hubs:
test.log("hub :", hub)
if(hub == "hub-t1"):
test.log("hub exists", hub)
else:
test.fail("No Hubs available ")
list_of_delivery_targets = dict['deliveryTargets']
if(len(list_of_delivery_targets) > 0):
for delivery_target in list_of_delivery_targets:
test.log("delivery delivery_target : ", delivery_target)
if(delivery_target == "VEVO"):
test.log("delivery_target exists", delivery_target)
else:
test.fail("No Delivery targets available ")
示例3: main
def main():
test.log("Test Case Name: tst_start_bulk_revert_delivery")
data = testData.dataset("s_list_of_webservices.tsv")[0]
get_delivery_status_url = testData.field(data, "get_delivery_status_url")
revert_all_deliveries_get_call = testData.field(data, "revert_all_deliveries_get_call")
data = testData.dataset("delivery_ids_for_bulk_reverting.tsv")[0]
parent_delivery_id = testData.field(data, "delivery_id")
videoISRC = testData.field(data, "videoISRC")
test.log(" get_delivery_status_url : " + get_delivery_status_url)
test.log(" revert_all_deliveries_get_call : " + revert_all_deliveries_get_call)
test.log(" delivery_id : " + parent_delivery_id)
test.log(" videoISRC: " + videoISRC)
data = testData.dataset("ftp_login_details.tsv")[0]
ftp_vevo_host = testData.field(data, "ftp_vevo_host")
ftp_vevo_user = testData.field(data, "ftp_vevo_user")
ftp_vevo_password = testData.field(data, "ftp_vevo_password")
manifest_parse_success_replace_success = findFile("testdata", "vevo_status\\parse_success_replace_success\\status-manifest.xml")
squish.snooze(40)
# latest_revert_id = "ff80808147da5cc80147e9c872f00172"
latest_revert_id = bulk_revert_delivery(revert_all_deliveries_get_call,get_delivery_status_url,parent_delivery_id)
if(latest_revert_id and latest_revert_id != None):
delivery_stage = check_delivery_status_until_waiting_on_confirmation(get_delivery_status_url, latest_revert_id)
ftp_transfer(get_delivery_status_url, parent_delivery_id, latest_revert_id, delivery_stage, ftp_vevo_host, ftp_vevo_user, ftp_vevo_password, manifest_parse_success_replace_success)
else:
test.fail("latest revert id is null or doesn't exist")
示例4: check_delivery_status
def check_delivery_status(check_delivery_status_url, delivery_id):
test.log("check delivery status")
source(findFile("scripts", "deliverywebservices.py"))
delivery_stage = check_delivery_status(check_delivery_status_url, delivery_id)
test.log(delivery_stage)
return delivery_stage
示例5: post_url_data
def post_url_data(url, data):
test.log("post_url_data")
test.log("url : " + url)
req = urllib2.Request(url)
req.add_header('Content-Type', 'application/json')
response = urllib2.urlopen(req, json.dumps(data))
dict = json.load(response)
return dict
示例6: repos_load
def repos_load(id, dumpfile):
log(id, "\n*** repos_load ("+str(id)+")\n")
tmp = test.mkdtemp(id)
run("svnadmin", "create", tmp, output = test.log(id))
run("svnadmin", "load", tmp, input = dumpfile, output = test.log(id))
return tmp
示例7: dump_reload
def dump_reload(id, dumpfile):
log(id, "\n*** dump_reload ("+str(id)+")\n")
tmp = test.mkdtemp(id)
run("svnadmin", "create", tmp, output = test.log(id))
run("svnadmin", "load", tmp, input = dumpfile, output = test.log(id))
dump = test.dumps(id)+"/validate.dump"
run("svnadmin", "dump", tmp, output = dump, error = test.log(id))
return dump
示例8: get_latest_revert_id_with_complete_url
def get_latest_revert_id_with_complete_url(complete_url):
test.log("get_latest_revert_id_with_complete_url: " + complete_url)
print complete_url
open = urllib2.urlopen(complete_url)
dict = json.load(open)
latest_revert_id = dict['latestRevertId']
print latest_revert_id
#test.log(" latest_revert_id is : " + latest_revert_id)
return latest_revert_id
示例9: bspatch
def bspatch(id, file, patch):
log(id, "\n*** bspatch ("+file+", "+patch+")\n")
tmp = mktemp(id)
try:
run("bspatch", file, tmp, patch, output = test.log(id), error = test.log(id))
shutil.move(tmp, file)
except:
return False
return True
示例10: check_revert_status_with_complete_url
def check_revert_status_with_complete_url(complete_url):
test.log("check_revert_status_with_complete_url: " + complete_url)
test.log("list of revert stages : REVERTED,REVERTING,REVERT_FAILED,UNREVERTABLE,UNREVERTABLE_DUPLICATE,UNREVERTABLE_NO_SOURCE,UNREVERTED")
print complete_url
open = urllib2.urlopen(complete_url)
dict = json.load(open)
revert_stage = dict['revertStage']
print revert_stage
#test.log("revert stage is : " + revert_stage)
return revert_stage
示例11: check_delivery_status_until_cancelled
def check_delivery_status_until_cancelled(check_delivery_status_url, delivery_id):
test.log("check_delivery_status_until_cancelled")
source(findFile("scripts", "deliverywebservices.py"))
while(True):
delivery_stage = check_delivery_status(check_delivery_status_url, delivery_id)
test.log(delivery_stage)
if(delivery_stage == "CANCELLED"):
return delivery_stage
elif (delivery_stage == "FAILED"):
test.fail("Delivery cancel failed")
return delivery_stage
示例12: get_list_of_files_folders_from_parent_folder_in_hub
def get_list_of_files_folders_from_parent_folder_in_hub(url, hub, json_data):
test.log("get_list_of_files_folders_from_parent_folder_in_hub")
test.log("url : " + url)
complete_url = url + hub + "/parent"
print complete_url
dict = post_url_data(complete_url, json_data)
files = dict['files']
new_data_dict = None
if(len(files) > 0):
print len(files)
else:
test.fail("no files exist in parent folder including the child file")
示例13: dump_reload_rsvndump_sub
def dump_reload_rsvndump_sub(id, dumpfile, path, args):
log(id, "\n*** dump_reload ("+str(id)+")\n")
tmp = test.mkdtemp(id)
run("svnadmin", "create", tmp, output = test.log(id))
run("svnadmin", "load", tmp, input = dumpfile, output = test.log(id))
dump = test.dumps(id)+"/validate.dump"
if not platform.system() == "Windows":
run("../../src/rsvndump", uri("file://"+tmp+"/"+path), extra_args = tuple(args), output = dump, error = test.log(id))
else:
run("../../bin/rsvndump.exe", uri("file://"+tmp+"/"+path), extra_args = tuple(args), output = dump, error = test.log(id))
return dump
示例14: stop_delivery
def stop_delivery(stop_cancel_delivery, delivery_id):
test.log("stop delivery : " + stop_cancel_delivery + delivery_id)
r = requests.post(stop_cancel_delivery + delivery_id)
print r.status_code
print r.text
if(r.text):
test.log("stopped or cancelled the delivery successfully")
else:
test.fail("Failed to cancel or stop the delivery")
示例15: bspatch
def bspatch(id, file, patch):
log(id, "\n*** bspatch ("+file+", "+patch+")\n")
tmp = mktemp(id)
try:
run("bspatch", file, tmp, patch, output = test.log(id), error = test.log(id))
shutil.move(tmp, file)
except OSError:
sys.stderr.write("'bspatch' executable missing?\n")
raise
except:
return False
return True