djLint/tests/test_golang/test_range.py

26 lines
645 B
Python
Raw Normal View History

2021-10-04 14:31:09 +00:00
"""Djlint tests specific to go-lang.
run::
pytest tests/test_golang.py --cov=src/djlint --cov-branch \
--cov-report xml:coverage.xml --cov-report term-missing
for a single test, run::
pytest tests/test_golang.py::test_inline_comment --cov=src/djlint \
--cov-branch --cov-report xml:coverage.xml --cov-report term-missing
"""
# pylint: disable=C0116
from typing import TextIO
from click.testing import CliRunner
from tests.conftest import reformat
2021-10-04 14:31:09 +00:00
def test_range(runner: CliRunner, tmp_file: TextIO) -> None:
output = reformat(tmp_file, runner, b"{{ range .Items }} {{ end }}")
2021-11-29 11:19:07 +00:00
assert output.exit_code == 0