From dc4783cbbd7a6265098003f939405de56e7ec00d Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 26 Dec 2019 19:25:43 +0000 Subject: [PATCH] Bug 1606009 - Extend the yaml test r=Callek Differential Revision: https://phabricator.services.mozilla.com/D58265 --HG-- extra : moz-landing-system : lando --- tools/lint/test/files/yaml/bad.yml | 1 + tools/lint/test/test_yaml.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/lint/test/files/yaml/bad.yml b/tools/lint/test/files/yaml/bad.yml index ab09bd3755bf..195ac7b030d7 100644 --- a/tools/lint/test/files/yaml/bad.yml +++ b/tools/lint/test/files/yaml/bad.yml @@ -5,3 +5,4 @@ yamllint: - .cron.yml - browser/config/ - wrong + application:bar diff --git a/tools/lint/test/test_yaml.py b/tools/lint/test/test_yaml.py index c4d206086439..0170d5ea9429 100644 --- a/tools/lint/test/test_yaml.py +++ b/tools/lint/test/test_yaml.py @@ -9,7 +9,7 @@ pytestmark = pytest.mark.skipif(not which('yamllint'), reason="yamllint is not i def test_basic(lint, paths): results = lint(paths()) - assert len(results) == 2 + assert len(results) == 3 assert "line too long (122 > 80 characters)" in results[0].message assert results[0].level == "error" @@ -21,6 +21,11 @@ def test_basic(lint, paths): assert "bad.yml" in results[1].relpath assert results[0].lineno == 3 + assert "could not find expected" in results[2].message + assert results[2].level == "error" + assert "bad.yml" in results[2].relpath + assert results[2].lineno == 9 + if __name__ == '__main__': mozunit.main()