Bug 1598615 - Ride along: add tests for rst r=ahal

Differential Revision: https://phabricator.services.mozilla.com/D54499

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Sylvestre Ledru 2019-11-25 20:09:05 +00:00
Родитель 4c2a29c270
Коммит d80ef5130e
5 изменённых файлов: 59 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,20 @@
============
Coding style
============
This document attempts to explain the basic styles and patterns used in
the Mozilla codebase. New code should try to conform to these standards,
so it is as easy to maintain as existing code. There are exceptions, but
it's still important to know the rules!
Whitespace
~~~~~~~~
Line length
~~~~~~~~~~~
Line length
~~~~~~~~~~~

Просмотреть файл

@ -0,0 +1,4 @@
====
Test
===

Просмотреть файл

@ -0,0 +1,11 @@
============
Coding style
============
This document attempts to explain the basic styles and patterns used in
the Mozilla codebase. New code should try to conform to these standards,
so it is as easy to maintain as existing code. There are exceptions, but
it's still important to know the rules!

Просмотреть файл

@ -13,3 +13,4 @@ skip-if = os == "win"
[test_file_license.py]
[test_lintpref.py]
[test_shellcheck.py]
[test_rst.py]

Просмотреть файл

@ -0,0 +1,23 @@
import pytest
import mozunit
from mozfile import which
LINTER = 'rst'
pytestmark = pytest.mark.skipif(not which('rstcheck'), reason="rstcheck is not installed")
def test_basic(lint, paths):
results = lint(paths())
assert len(results) == 2
assert "Title underline too short" in results[0].message
assert results[0].level == "error"
assert results[0].relpath == "bad.rst"
assert "Title overline & underline mismatch" in results[1].message
assert results[1].level == "error"
assert results[1].relpath == "bad2.rst"
if __name__ == '__main__':
mozunit.main()