2014-02-03 09:45:38 +00:00
|
|
|
from __future__ import unicode_literals
|
2014-02-03 09:59:28 +00:00
|
|
|
from tqdm import format_interval, format_meter
|
2014-02-03 09:45:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_format_interval():
|
|
|
|
assert format_interval(60) == '01:00'
|
|
|
|
assert format_interval(6160) == '1:42:40'
|
|
|
|
assert format_interval(238113) == '66:08:33'
|
|
|
|
|
2014-02-03 09:59:28 +00:00
|
|
|
|
|
|
|
def test_format_meter():
|
|
|
|
assert format_meter(231, 1000, 392) == \
|
|
|
|
"|##--------| 231/1000 23% [elapsed: " \
|
|
|
|
"06:32 left: 12:49, 0.00 iters/sec]"
|
|
|
|
|