* 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
14 lines
439 B
Python
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}"'
|