зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
4c2a29c270
Коммит
d80ef5130e
|
@ -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()
|
Загрузка…
Ссылка в новой задаче