FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-progressbar/tests/test_speed.py at develop · commit-0/python-progressbar · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
commit-0
/
python-progressbar
Public
forked from
wolph/python-progressbar
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-progressbar
/
tests
/
test_speed.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
36 lines (33 loc) · 929 Bytes
Breadcrumbs
python-progressbar
/
tests
/
test_speed.py
Copy path
File metadata and controls
36 lines (33 loc) · 929 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import
pytest
import
progressbar
@
pytest
.
mark
.
parametrize
(
'total_seconds_elapsed,value,expected'
,
[
(
1
,
0
,
' 0.0 s/B'
),
(
1
,
0.01
,
'100.0 s/B'
),
(
1
,
0.1
,
' 0.1 B/s'
),
(
1
,
1
,
' 1.0 B/s'
),
(
1
,
2
**
10
-
1
,
'1023.0 B/s'
),
(
1
,
2
**
10
+
0
,
' 1.0 KiB/s'
),
(
1
,
2
**
20
,
' 1.0 MiB/s'
),
(
1
,
2
**
30
,
' 1.0 GiB/s'
),
(
1
,
2
**
40
,
' 1.0 TiB/s'
),
(
1
,
2
**
50
,
' 1.0 PiB/s'
),
(
1
,
2
**
60
,
' 1.0 EiB/s'
),
(
1
,
2
**
70
,
' 1.0 ZiB/s'
),
(
1
,
2
**
80
,
' 1.0 YiB/s'
),
(
1
,
2
**
90
,
'1024.0 YiB/s'
),
],
)
def
test_file_transfer_speed
(
total_seconds_elapsed
,
value
,
expected
)
->
None
:
widget
=
progressbar
.
FileTransferSpeed
()
assert
(
widget
(
None
,
dict
(
total_seconds_elapsed
=
total_seconds_elapsed
,
value
=
value
,
),
)
==
expected
)
Back
|
FazBrowse Home
|
New Git URL