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

Ensure names containing characters other than a-z A-Z 0-9 or _ are unique (#5810)

This commit is contained in:
J. Nick Koston
2023-11-24 00:29:08 +01:00
committed by GitHub
parent 9f8a896e13
commit 5c31bec8c2
3 changed files with 14 additions and 8 deletions

View File

@@ -258,9 +258,9 @@ def test_snake_case(text, expected):
"text, expected",
(
("foo_bar", "foo_bar"),
('!"§$%&/()=?foo_bar', "foo_bar"),
('foo_!"§$%&/()=?bar', "foo_bar"),
('foo_bar!"§$%&/()=?', "foo_bar"),
('!"§$%&/()=?foo_bar', "___________foo_bar"),
('foo_!"§$%&/()=?bar', "foo____________bar"),
('foo_bar!"§$%&/()=?', "foo_bar___________"),
),
)
def test_sanitize(text, expected):