Skip to content

Commit

Permalink
Remove htpy2html test_convert_complex_svg.
Browse files Browse the repository at this point in the history
It is annoying when it fails since it has so much stuff in it. Also it
used Black when there is another test that tests the black usage.
  • Loading branch information
pelme committed Oct 14, 2024
1 parent dbc2ed1 commit a053e81
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions tests/test_html2htpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,55 +317,6 @@ def test_convert_complex_section() -> None:
assert actual == expected


def test_convert_complex_svg() -> None:
path_d: str = (
"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2"
".652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1"
".13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8."
"932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.2"
"5 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75"
"V8.25A2.25 2.25 0 0 1 5.25 6H10"
)

input = f"""
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none" viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="w-6 h-6">
<path
stroke-linecap="round"
stroke-linejoin="round"
d="{path_d}"
/>
</svg>
"""

actual_output = html2htpy(input, formatter=BlackFormatter(), import_mode="no")

expected_output = textwrap.dedent(
f"""\
svg(
".w-6.h-6",
xmlns="http://www.w3.org/2000/svg",
fill="none",
viewbox="0 0 24 24",
stroke_width="1.5",
stroke="currentColor",
)[
path(
stroke_linecap="round",
stroke_linejoin="round",
d="{path_d}",
)
]
"""
)

assert expected_output == actual_output


def test_reserved_keyword_attributes() -> None:
actual = html2htpy('<img class="foo" del="x">', shorthand_id_class=False, import_mode="no")
expected = 'img(class_="foo", del_="x")'
Expand Down

0 comments on commit a053e81

Please sign in to comment.