breadtube-bot/tests/test_unidecode.py
BreadTube d015927861 Special characters handling
* Fix README for python version
* Add discord-friendly unidecode function for channel names (avoiding
  special characted)
* Check if "items" is present before accessing in channel id request
  response
2026-02-03 01:30:41 +09:00

14 lines
439 B
Python

from breadtube_bot.unidecode import unidecode
def test_unidecode():
test_data = [
('éêçà', 'eeca'),
('あいうえお', 'aiueo'),
('アイウエオ', 'aiueo'),
('ČŽŠčžš', 'czsczs'),
('?! .,<', '______'),
]
for data, expected in test_data:
result = unidecode(data)
assert result == expected, f'Wrong result for "{data}": got "{result}", expected "{expected}"'