File: test_progressbar.py

package info (click to toggle)
translate-toolkit 3.19.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,144 kB
  • sloc: python: 73,754; sh: 1,412; makefile: 185; xml: 48
file content (11 lines) | stat: -rw-r--r-- 428 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
from translate.misc import progressbar


def test_hashprogressbar() -> None:
    """Test the [###   ] progress bar."""
    bar = progressbar.HashProgressBar()
    assert str(bar) == "[                                           ]   0%"
    bar.amount = 50
    assert str(bar) == "[######################                     ]  50%"
    bar.amount = 100
    assert str(bar) == "[###########################################] 100%"