Modify testrail to use global variable for TR URL and project ID

This commit is contained in:
bealler
2020-12-16 15:01:36 -05:00
parent 0ed6c31976
commit 42cdf6c047

View File

@@ -16,6 +16,7 @@ from pprint import pprint
import os
tr_user=os.getenv('TR_USER')
tr_pw=os.getenv('TR_PWD')
project = os.getenv('PROJECT_ID')
class APIClient:
@@ -125,7 +126,7 @@ class APIClient:
def get_run_id(self, test_run_name):
"Get the run ID using test name and project name"
run_id = None
project_id = client.get_project_id(project_name=project_id)
project_id = client.get_project_id(project_name=project)
try:
test_runs = client.send_get('get_runs/%s' % (project_id))
@@ -180,7 +181,7 @@ class APIClient:
print("result in post", result)
client: APIClient = APIClient(os.getenv('TESTRAIL_URL'))
project_id = os.getenv('PROJECT_ID')
class APIError(Exception):
pass