diff --git a/tests/test_new.diff b/tests/test_new.diff index 56b1f92..88f647f 100644 --- a/tests/test_new.diff +++ b/tests/test_new.diff @@ -347,37 +347,6 @@ index 0000000..525e25d +++ b/example_file.qmd @@ -0,0 +0,1 @@ + -diff --git a/config.jsonc b/config.jsonc -new file mode 100644 -index 0000000..525e25d ---- /dev/null -+++ b/config.jsonc -@@ -0,0 +0,11 @@ -+{ -+ "myConfig": [ -+ /* -+ GitRepository where 'Git release/tag' -+ matches 'Helm' version -+ */ -+ "itIsWonderful", -+ // TODO: Delete this line from the codebase -+ "butItHasSomePendingActivities" -+ ] -+} -diff --git a/config.json5 b/config.json5 -new file mode 100644 -index 0000000..525e25d ---- /dev/null -+++ b/config.json5 -@@ -0,0 +0,8 @@ -+{ -+ "myConfig": [ -+ // GitRepository where 'Git release/tag' matches 'Helm' version -+ "itIsWonderful", -+ // TODO: Delete this line from the codebase -+ "butItHasSomePendingActivities" -+ ] -+} diff --git a/example.clj b/example.clj new file mode 100644 index 0000000..525e25d diff --git a/tests/test_new2.diff b/tests/test_new2.diff new file mode 100644 index 0000000..f145ea6 --- /dev/null +++ b/tests/test_new2.diff @@ -0,0 +1,31 @@ +diff --git a/config.jsonc b/config.jsonc +new file mode 100644 +index 0000000..525e25d +--- /dev/null ++++ b/config.jsonc +@@ -0,0 +0,11 @@ ++{ ++ "myConfig": [ ++ /* ++ GitRepository where 'Git release/tag' ++ matches 'Helm' version ++ */ ++ "itIsWonderful", ++ // TODO: Delete this line from the codebase ++ "butItHasSomePendingActivities" ++ ] ++} +diff --git a/config.json5 b/config.json5 +new file mode 100644 +index 0000000..525e25d +--- /dev/null ++++ b/config.json5 +@@ -0,0 +0,8 @@ ++{ ++ "myConfig": [ ++ // GitRepository where 'Git release/tag' matches 'Helm' version ++ "itIsWonderful", ++ // TODO: Delete this line from the codebase ++ "butItHasSomePendingActivities" ++ ] ++} diff --git a/tests/test_process_diff.py b/tests/test_process_diff.py index 0867716..769412e 100644 --- a/tests/test_process_diff.py +++ b/tests/test_process_diff.py @@ -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 URL successfully inserted'), 82) + self.assertEqual(output.getvalue().count('Issue URL successfully inserted'), 80) def tearDown(self): # return to original working directory to ensure we don't mess up other tests diff --git a/tests/test_todo_parser.py b/tests/test_todo_parser.py index c97c5f2..34b94c1 100644 --- a/tests/test_todo_parser.py +++ b/tests/test_todo_parser.py @@ -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.