This repository has been archived by the owner on Feb 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hanhxiao
committed
Sep 17, 2019
1 parent
8828535
commit 65fff1a
Showing
2 changed files
with
25 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import time | ||
import unittest | ||
|
||
from gnes.client.cli import ProgressBar | ||
|
||
|
||
class TestProgessbar(unittest.TestCase): | ||
def setUp(self): | ||
self.bar_len = 20 | ||
|
||
def test_progressbar5(self): | ||
# should be 5 line | ||
with ProgressBar(task_name='test', bar_len=self.bar_len) as pb: | ||
for j in range(5 * self.bar_len): | ||
pb.update() | ||
|
||
def test_progressbar1(self): | ||
# should be single line | ||
with ProgressBar(task_name='test', bar_len=self.bar_len) as pb: | ||
for j in range(self.bar_len): | ||
pb.update() | ||
time.sleep(.1) |