I'm looking to write unit tests for the following code. Please help me figure out the solution.
def jiraConnect(username, password):
try:
logger.info("Connecting to Jira")
jira = JIRA(basic_auth = (username, password), options = {'server':'<ip-address/url>'})
logger.info("Connected to Jira")
return jira
except JIRAError as e:
return e.status_code, e.text
def getIssues(jql, field_list):
try:
size = 100
initial = 0
allIssues = []
while True:
start = initial*size
issues = jc.search_issues(f"{jql}", start, size, fields = field_list)
if(len(issues)==0:
break
initial += 1
for issue in issues:
allIssues.append(issue)
return allIssues
except JIRAError as e:
return e.status_code, e.text
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.