Bug 1874684 - Part 17: Fix uninitialised variable warnings from clang-tidy. r=allstarschh
[gecko.git] / tools / lint / test / test_updatebot.py
blob5763cc1a7ab0ad0991079b497fa251ea11ceb992
1 import os
3 import mozunit
5 LINTER = "updatebot"
8 def test_basic(lint, paths):
9 results = []
11 for p in paths():
12 for root, dirs, files in os.walk(p):
13 for f in files:
14 if f == ".yamllint":
15 continue
17 filepath = os.path.join(root, f)
18 result = lint(filepath, testing=True)
19 if result:
20 results.append(result)
22 assert len(results) == 2
24 expected_results = 0
26 for r in results:
27 if "no-revision.yaml" in r[0].path:
28 expected_results += 1
29 assert "no-revision.yaml" in r[0].path
30 assert (
31 'If "vendoring" is present, "revision" must be present in "origin"'
32 in r[0].message
35 if "cargo-mismatch.yaml" in r[0].path:
36 expected_results += 1
37 assert "cargo-mismatch.yaml" in r[0].path
38 assert "wasn't found in Cargo.lock" in r[0].message
40 assert expected_results == 2
43 if __name__ == "__main__":
44 mozunit.main()