1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-06-23 06:25:26 +00:00
toot/tests
Denis Laxalde 0bf4b2a21a
Fix left column padding in timeline with wide characters
When the left column contains wide characters (which occupy more than
one cell when printed to screen), padding to 30-characters with
"{:30}".format() does not work well. This happens for instance when the
display name contains unicode characters such as emojis.

We fix this by introducing a pad() function in utils module which uses
the wcwidth library (https://pypi.org/project/wcwidth/) to compute the
length of the text for the column. trunc() function is also adjusted to
optionally compute the length of the text to be truncated since, when
called from pad(), we now pre-compute this value.

We update test for timeline rendering so that the display name now
includes an emoji. (Without the fix, the test would not pass as left
column would be misaligned.)
2019-02-14 14:21:53 +01:00
..
__init__.py Add coding directive 2017-04-15 14:53:08 +02:00
test_api.py Simplify mocking in tests 2018-06-07 10:05:14 +02:00
test_auth.py Reimplement configuration to allow multiple logins 2018-01-02 12:24:32 +01:00
test_config.py Fix XDG_CONFIG_HOME tests 2018-04-17 21:09:26 +02:00
test_console.py Fix left column padding in timeline with wide characters 2019-02-14 14:21:53 +01:00
test_utils.py Fix left column padding in timeline with wide characters 2019-02-14 14:21:53 +01:00
test_version.py Add __version__ to init file 2018-01-15 12:19:37 +01:00
utils.py Simplify mocking in tests 2018-06-07 10:05:14 +02:00