Backed out 2 changesets (bug 1943998) for causing wd failures @ phases.py CLOSED...
[gecko.git] / tools / lint / test / test_file_license.py
blob250d4a0778e6bdf6d18a8a617130c7e01f85190a
1 import mozunit
3 LINTER = "license"
4 fixed = 0
7 def test_lint_license(lint, paths):
8 results = lint(paths())
9 print(results)
10 assert len(results) == 3
12 assert ".eslintrc.js" in results[0].relpath
14 assert "No matching license strings" in results[1].message
15 assert results[1].level == "error"
16 assert "bad.c" in results[1].relpath
18 assert "No matching license strings" in results[2].message
19 assert results[2].level == "error"
20 assert "bad.js" in results[2].relpath
23 def test_lint_license_fix(lint, paths, create_temp_file):
24 contents = """let foo = 0;"""
25 path = create_temp_file(contents, "lint_license_test_tmp_file.js")
26 results = lint([path], fix=True)
28 assert len(results) == 0
29 assert fixed == 1
32 if __name__ == "__main__":
33 mozunit.main()