Bug 1874684 - Part 17: Fix uninitialised variable warnings from clang-tidy. r=allstarschh
[gecko.git] / tools / lint / test / test_file_perm.py
blob08d6a20eef0a6de9bdc8587cc010fc53196d6a9a
1 import mozunit
2 import pytest
4 LINTER = "file-perm"
7 @pytest.mark.lint_config(name="file-perm")
8 def test_lint_file_perm(lint, paths):
9 results = lint(paths("no-shebang"), collapse_results=True)
11 assert results.keys() == {
12 "no-shebang/bad.c",
13 "no-shebang/bad-shebang.c",
14 "no-shebang/bad.png",
17 for path, issues in results.items():
18 for issue in issues:
19 assert "permissions on a source" in issue.message
20 assert issue.level == "error"
23 @pytest.mark.lint_config(name="maybe-shebang-file-perm")
24 def test_lint_shebang_file_perm(config, lint, paths):
25 results = lint(paths("maybe-shebang"))
27 assert len(results) == 1
29 assert "permissions on a source" in results[0].message
30 assert results[0].level == "error"
31 assert results[0].relpath == "maybe-shebang/bad.js"
34 if __name__ == "__main__":
35 mozunit.main()