test: print message when issue URL has actually been inserted

Insertion of the URL is different from simply
creating/updating the issue, so we want to have
this level of output to ensure that as many
file updates as expected are actually occurring.

Note: The unit test is currently failing!
This commit is contained in:
Robert Alonso 2024-11-08 20:37:56 +00:00
parent 590a050199
commit cd754de86c
2 changed files with 2 additions and 1 deletions

View File

@ -84,6 +84,7 @@ def process_diff(diff, client=Client(), insert_issue_urls=False, parser=TodoPars
file_lines.insert(line_number + 1, new_line)
with open(raw_issue.file_name, 'w') as issue_file:
issue_file.writelines(file_lines)
print('Issue URL successfully inserted', file=output)
elif status_code == 200:
print(f'Issue updated: #{new_issue_number} @ {client.get_issue_url(new_issue_number)}', file=output)
else:

View File

@ -48,7 +48,7 @@ class IssueUrlInsertionTest(unittest.TestCase):
# process the diffs
process_diff(diff=self.diff_file, insert_issue_urls=True, parser=self.parser, output=output)
# make sure the number of issue URL comments inserted is as expected
self.assertEqual(output.getvalue().count('Issue created: #None @ N/A'), 82)
self.assertEqual(output.getvalue().count('Issue URL successfully inserted'), 82)
def tearDown(self):
# return to original working directory to ensure we don't mess up other tests