-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #632 from Riverside-Healthcare/dev
- Loading branch information
Showing
13 changed files
with
668 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
"""Tests html details/summary tag. | ||
poetry run pytest tests/test_html/test_tag_details_summary.py | ||
""" | ||
import pytest | ||
|
||
from src.djlint.reformat import formatter | ||
from tests.conftest import config_builder, printer | ||
|
||
test_data = [ | ||
pytest.param( | ||
( | ||
'<div attribute="value" attributea="value" attributeb="value" attributec="value" attributed="value" attributef="value">string</div>\n' | ||
), | ||
( | ||
'<div attribute="value"\n' | ||
' attributea="value"\n' | ||
' attributeb="value"\n' | ||
' attributec="value"\n' | ||
' attributed="value"\n' | ||
' attributef="value">string</div>\n' | ||
), | ||
({}), | ||
id="no_line_break_after_multiline_tag", | ||
), | ||
pytest.param( | ||
( | ||
'<div attribute="value"\n' | ||
' attributea="value"\n' | ||
' attributeb="value"\n' | ||
' attributec="value"\n' | ||
' attributed="value"\n' | ||
' attributef="value">\n' | ||
" string\n" | ||
"</div>\n" | ||
), | ||
( | ||
'<div attribute="value"\n' | ||
' attributea="value"\n' | ||
' attributeb="value"\n' | ||
' attributec="value"\n' | ||
' attributed="value"\n' | ||
' attributef="value">string</div>\n' | ||
), | ||
({}), | ||
id="no_line_break_after_multiline_tag_when_already_split", | ||
), | ||
pytest.param( | ||
( | ||
'<div attribute="value" attributea="value" attributeb="value" attributec="value" attributed="value" attributef="value">string</div>\n' | ||
), | ||
( | ||
'<div attribute="value"\n' | ||
' attributea="value"\n' | ||
' attributeb="value"\n' | ||
' attributec="value"\n' | ||
' attributed="value"\n' | ||
' attributef="value">\n' | ||
" string\n" | ||
"</div>\n" | ||
), | ||
({"line_break_after_multiline_tag": True}), | ||
id="line_break_after_multiline_tag", | ||
), | ||
pytest.param( | ||
( | ||
'<div attribute="value"\n' | ||
' attributea="value"\n' | ||
' attributeb="value"\n' | ||
' attributec="value"\n' | ||
' attributed="value"\n' | ||
' attributef="value">string</div>\n' | ||
), | ||
( | ||
'<div attribute="value"\n' | ||
' attributea="value"\n' | ||
' attributeb="value"\n' | ||
' attributec="value"\n' | ||
' attributed="value"\n' | ||
' attributef="value">\n' | ||
" string\n" | ||
"</div>\n" | ||
), | ||
({"line_break_after_multiline_tag": True}), | ||
id="line_break_after_multiline_tag_when_already_condensed", | ||
), | ||
] | ||
|
||
|
||
@pytest.mark.parametrize(("source", "expected", "args"), test_data) | ||
def test_base(source, expected, args): | ||
output = formatter(config_builder(args), source) | ||
|
||
printer(expected, source, output) | ||
assert expected == output |
Oops, something went wrong.