mirror of
https://github.com/Hopiu/djLint.git
synced 2026-04-05 23:11:00 +00:00
32 lines
981 B
Python
32 lines
981 B
Python
"""Djlint tests specific to linter output format.
|
|
|
|
run::
|
|
|
|
pytest tests/test_config_linter_output_format.py --cov=src/djlint --cov-branch \
|
|
--cov-report xml:coverage.xml --cov-report term-missing
|
|
|
|
for a single test, run::
|
|
|
|
pytest tests/test_config_linter_output_format.py::test_with_config --cov=src/djlint \
|
|
--cov-branch --cov-report xml:coverage.xml --cov-report term-missing
|
|
|
|
"""
|
|
# pylint: disable=C0116
|
|
|
|
from click.testing import CliRunner
|
|
|
|
from src.djlint import main as djlint
|
|
|
|
|
|
def test_with_config(runner: CliRunner) -> None:
|
|
result = runner.invoke(djlint, ["tests/config_linter_output_format", "--lint"])
|
|
assert result.exit_code == 1
|
|
|
|
print(result.output)
|
|
assert (
|
|
"""html-one.html:1:0: H025 Tag seems to be an orphan. <h1>
|
|
html-one.html:1:8: H025 Tag seems to be an orphan. </h2>
|
|
html-two.html:1:0: H025 Tag seems to be an orphan. <h1>
|
|
html-two.html:1:8: H025 Tag seems to be an orphan. </h2>"""
|
|
in result.output
|
|
)
|