| 1 |
import pytest |
| 2 |
|
| 3 |
from sphinx_design.icons import get_material_icon_data, get_octicon_data |
| 4 |
|
| 5 |
|
| 6 |
def test_octicons(file_regression): |
| 7 |
"""Test the available octicon names. |
| 8 |
|
| 9 |
This is intended to provide a diff of the octicons available, |
| 10 |
when the octicons are updated, to check if we are removing any |
| 11 |
(and hence breaking back-compatibility). |
| 12 |
""" |
| 13 |
data = get_octicon_data() |
| 14 |
content = "" |
| 15 |
for octicon in sorted(data): |
| 16 |
content += f"{octicon}: {','.join(data[octicon]['heights'])}\n" |
| 17 |
file_regression.check(content) |
| 18 |
|
| 19 |
|
| 20 |
@pytest.mark.parametrize("style", ["regular", "outlined", "round", "sharp", "twotone"]) |
| 21 |
def test_material(style, file_regression): |
| 22 |
"""Test the available material icons names. |
| 23 |
|
| 24 |
This is intended to provide a diff of the octicons available, |
| 25 |
when the octicons are updated, to check if we are removing any |
| 26 |
(and hence breaking back-compatibility). |
| 27 |
""" |
| 28 |
data = get_material_icon_data(style) |
| 29 |
content = "" |
| 30 |
for name in sorted(data): |
| 31 |
content += f"{name}: {','.join(data[name]['heights'])}\n" |
| 32 |
file_regression.check(content) |