Debian Codegraph @

tests/test_unicode.py

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 from __future__ import annotations
2
3 import time
4
5 import pytest
6 from python_utils import converters
7
•8 import progressbar2
9
10
11 @pytest.mark.parametrize(
12 'name,markers',
13 [
14 ('line arrows', '←↖↑↗→↘↓↙'),
15 ('block arrows', '◢◣◤◥'),
16 ('wheels', '◐◓◑◒'),
17 ],
18 )
19 @pytest.mark.parametrize('as_unicode', [True, False])
20 def test_markers(name, markers: bytes | str, as_unicode) -> None:
21 if as_unicode:
22 markers = converters.to_unicode(markers)
23 else:
24 markers = converters.to_str(markers)
25
26 widgets = [
27 f'{name.capitalize()}: ',
•28 progressbar2.AnimatedMarker(markers=markers),
29 ]
•30 bar = progressbar2.ProgressBar(widgets=widgets)
31 bar._MINIMUM_UPDATE_INTERVAL = 1e-12
32 for _i in bar(iter(range(24))):
33 time.sleep(0.001)