test_result.py (719B)
1 # This Source Code Form is subject to the terms of the Mozilla Public 2 # License, v. 2.0. If a copy of the MPL was not distributed with this 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 5 import mozunit 6 7 from mozlint.result import Issue, ResultSummary 8 9 10 def test_issue_defaults(): 11 ResultSummary.root = "/fake/root" 12 13 issue = Issue(linter="linter", path="path", message="message", lineno=None) 14 assert issue.lineno == 0 15 assert issue.column is None 16 assert issue.level == "error" 17 18 issue = Issue( 19 linter="linter", path="path", message="message", lineno="1", column="2" 20 ) 21 assert issue.lineno == 1 22 assert issue.column == 2 23 24 25 if __name__ == "__main__": 26 mozunit.main()