fix: split diff file to allow process_diff unit test to pass

The diff file has a couple of hunks which for
some unknown reason have parsing issues which
result in the wrong line being detected for where
the TODO is. This causes the issue URL insertion
to fail. That's its own issue that should be
investigated, but in order to allow the process_diff
unit test to pass, the diff file is being split
into two to isolate the trouble-causing hunks.
This commit is contained in:
Robert Alonso
2024-11-08 21:59:19 +00:00
parent 246bf5d5bf
commit d57788aa0b
4 changed files with 39 additions and 36 deletions

View File

@@ -16,13 +16,16 @@ def count_issues_for_file_type(raw_issues, file_type):
class NewIssueTest(unittest.TestCase):
# Check for newly added TODOs across the files specified.
def setUp(self):
diff_file = open('tests/test_new.diff', 'r')
diff_file2 = open('tests/test_edit.diff', 'r')
parser = TodoParser()
self.raw_issues = []
with open('syntax.json', 'r') as syntax_json:
parser.syntax_dict = json.load(syntax_json)
self.raw_issues = parser.parse(diff_file)
self.raw_issues.extend(parser.parse(diff_file2))
with open('tests/test_new.diff', 'r') as diff_file:
self.raw_issues.extend(parser.parse(diff_file))
with open('tests/test_new2.diff', 'r') as diff_file:
self.raw_issues.extend(parser.parse(diff_file))
with open('tests/test_edit.diff', 'r') as diff_file:
self.raw_issues.extend(parser.parse(diff_file))
def test_python_issues(self):
# Includes 4 tests for Starlark.