Buckets:

download
raw
2.54 kB
import pytest
from bs4 import PageElement
@pytest.mark.parametrize(
"template_string,expected_string",
[
pytest.param(
"""<Icon name="minus"/>""",
"""
<svg
aria-hidden="true"
fill="currentColor"
viewbox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg">
<path clip-rule="evenodd"
d="M4.25 12a.75.75 0 0 1 .75-.75h14a.75.75 0 0 1 0 1.5H5a.75.75 0 0 1-.75-.75Z"
fill-rule="evenodd"></path>
</svg>
""",
id="icon",
),
pytest.param(
"""<Icon name="minus" id="hyphen-1"/>""",
"""
<svg
id="hyphen-1"
aria-hidden="true"
fill="currentColor"
viewbox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg">
<path clip-rule="evenodd"
d="M4.25 12a.75.75 0 0 1 .75-.75h14a.75.75 0 0 1 0 1.5H5a.75.75 0 0 1-.75-.75Z"
fill-rule="evenodd"></path>
</svg>
""",
id="icon-id",
),
pytest.param(
"""<Icon name="minus" class="p-4"/>""",
"""
<svg
class="p-4"
aria-hidden="true"
fill="currentColor"
viewbox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg">
<path clip-rule="evenodd"
d="M4.25 12a.75.75 0 0 1 .75-.75h14a.75.75 0 0 1 0 1.5H5a.75.75 0 0 1-.75-.75Z"
fill-rule="evenodd"></path>
</svg>
""",
id="icon-class",
),
pytest.param(
"""<Icon name="minus" id="hyp" class="danger" title="deletion protocol"/>""",
"""
<svg
id="hyp"
class="danger"
aria-hidden="true"
fill="currentColor"
viewbox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg">
<path clip-rule="evenodd"
d="M4.25 12a.75.75 0 0 1 .75-.75h14a.75.75 0 0 1 0 1.5H5a.75.75 0 0 1-.75-.75Z"
fill-rule="evenodd"><title>deletion protocol</title></path>
</svg>
""",
id="icon-id-class-title",
),
],
)
def test_Icon(soup_rendered: PageElement, soup_expected: PageElement):
assert soup_rendered == soup_expected

Xet Storage Details

Size:
2.54 kB
·
Xet hash:
4e6394a6825878550bd3d8534efae4de4391c390d4f9d5a111c9c699f16b0f2c

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.