1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 11:22:24 +01:00

Sort resolved IP addresses for dashboard (#8536)

Co-authored-by: J. Nick Koston <nick+github@koston.org>
This commit is contained in:
David Woodhouse
2025-04-17 02:19:55 +01:00
committed by GitHub
parent 4a65fd76b3
commit 3c7bb65a23
3 changed files with 52 additions and 3 deletions

View File

@@ -267,3 +267,13 @@ def test_sanitize(text, expected):
actual = helpers.sanitize(text)
assert actual == expected
@pytest.mark.parametrize(
"text, expected",
((["127.0.0.1", "fe80::1", "2001::2"], ["2001::2", "127.0.0.1", "fe80::1"]),),
)
def test_sort_ip_addresses(text: list[str], expected: list[str]) -> None:
actual = helpers.sort_ip_addresses(text)
assert actual == expected