FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-progressbar/tests/test_end.py at develop · KarrLab/python-progressbar · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
KarrLab
/
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_end.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
51 lines (36 loc) · 1.03 KB
Breadcrumbs
python-progressbar
/
tests
/
test_end.py
Copy path
File metadata and controls
51 lines (36 loc) · 1.03 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import
pytest
import
progressbar
@
pytest
.
fixture
(
autouse
=
True
)
def
large_interval
(
monkeypatch
):
# Remove the update limit for tests by default
monkeypatch
.
setattr
(
progressbar
.
ProgressBar
,
'_MINIMUM_UPDATE_INTERVAL'
,
0.1
)
def
test_end
():
m
=
24514315
p
=
progressbar
.
ProgressBar
(
widgets
=
[
progressbar
.
Percentage
(),
progressbar
.
Bar
()],
max_value
=
m
)
for
x
in
range
(
0
,
m
,
8192
):
p
.
update
(
x
)
data
=
p
.
data
()
assert
data
[
'percentage'
]
<
100.
p
.
finish
()
data
=
p
.
data
()
assert
data
[
'percentage'
]
>=
100.
assert
p
.
value
==
m
def
test_end_100
(
monkeypatch
):
assert
progressbar
.
ProgressBar
.
_MINIMUM_UPDATE_INTERVAL
==
0.1
p
=
progressbar
.
ProgressBar
(
widgets
=
[
progressbar
.
Percentage
(),
progressbar
.
Bar
()],
max_value
=
103
,
)
for
x
in
range
(
0
,
102
):
p
.
update
(
x
)
data
=
p
.
data
()
import
pprint
pprint
.
pprint
(
data
)
assert
data
[
'percentage'
]
<
100.
p
.
finish
()
data
=
p
.
data
()
assert
data
[
'percentage'
]
>=
100.
Back
|
FazBrowse Home
|
New Git URL