Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
| 1 |
import pytest |
| 2 |
|
| 3 |
import progressbar |
| 4 |
|
| 5 |
|
| 6 |
@pytest.mark.parametrize( |
| 7 |
'value,expected', |
| 8 |
[ |
| 9 |
(None, ' 0.0 B'), |
| 10 |
(1, ' 1.0 B'), |
| 11 |
(2**10 - 1, '1023.0 B'), |
| 12 |
(2**10 + 0, ' 1.0 KiB'), |
| 13 |
(2**20, ' 1.0 MiB'), |
| 14 |
(2**30, ' 1.0 GiB'), |
| 15 |
(2**40, ' 1.0 TiB'), |
| 16 |
(2**50, ' 1.0 PiB'), |
| 17 |
(2**60, ' 1.0 EiB'), |
| 18 |
(2**70, ' 1.0 ZiB'), |
| 19 |
(2**80, ' 1.0 YiB'), |
| 20 |
(2**90, '1024.0 YiB'), |
| 21 |
], |
| 22 |
) |
| 23 |
def test_data_size(value, expected) -> None: |
| 24 |
widget = progressbar.DataSize() |
| 25 |
assert widget(None, dict(value=value)) == expected |