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
This commit is contained in:
parent
8d76596ebf
commit
d015927861
10 changed files with 315 additions and 13 deletions
14
tests/test_unidecode.py
Normal file
14
tests/test_unidecode.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
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}"'
|
||||
Loading…
Add table
Add a link
Reference in a new issue