mirror of
https://github.com/Hopiu/djLint.git
synced 2026-05-21 19:31:53 +00:00
--preser-blank-lines option can be used to try and keep existing blank lines during formatting. closes #261
29 lines
745 B
Python
29 lines
745 B
Python
"""Djlint tests specific to --preserve-leading-space option.
|
|
|
|
run::
|
|
|
|
pytest tests/test_config/test_preserve_blank_lines/test_config.py --cov=src/djlint --cov-branch \
|
|
--cov-report xml:coverage.xml --cov-report term-missing
|
|
|
|
pytest tests/test_config/test_preserve_blank_lines/test_config.py::test_config
|
|
|
|
"""
|
|
# pylint: disable=C0116
|
|
from click.testing import CliRunner
|
|
|
|
from src.djlint import main as djlint
|
|
|
|
|
|
def test_config(runner: CliRunner) -> None:
|
|
|
|
result = runner.invoke(
|
|
djlint,
|
|
[
|
|
"tests/test_config/test_preserve_blank_lines/html.html",
|
|
"--check",
|
|
"--preserve-leading-space",
|
|
"--preserve-blank-lines",
|
|
],
|
|
)
|
|
|
|
assert result.exit_code == 0
|