def _upload(url, data_file, username, password):
"""
Upload will submit a results file via polarion ReST interface.
"""
url_match = '(http(s)?)\:\/\/localhost'
if re.search(url_match, url):
print("Please configure url settings.")
exit(1)
polarion_request = post(url,
data=data_file,
auth=auth.HTTPBasicAuth(username,
password))
status_code = polarion_request.status_code
if status_code == codes.ok:
return status_code
else:
print("Results upload failed with the follow: {}".format(
polarion_request.status_code))
raise exceptions.RequestException
评论列表
文章目录