feat: add basic support for progress indicators
This commit is contained in:
parent
110ff69d6d
commit
4b9db13b8f
9 changed files with 248 additions and 1 deletions
|
@ -7,6 +7,7 @@ from unittest.mock import patch, MagicMock
|
|||
import pytest
|
||||
|
||||
from wuttjamaican import util as mod
|
||||
from wuttjamaican.progress import ProgressBase
|
||||
|
||||
|
||||
class A: pass
|
||||
|
@ -260,3 +261,19 @@ class TestMakeTitle(TestCase):
|
|||
def test_basic(self):
|
||||
text = mod.make_title('foo_bar')
|
||||
self.assertEqual(text, "Foo Bar")
|
||||
|
||||
|
||||
class TestProgressLoop(TestCase):
|
||||
|
||||
def test_basic(self):
|
||||
|
||||
def act(obj, i):
|
||||
pass
|
||||
|
||||
# with progress
|
||||
mod.progress_loop(act, [1, 2, 3], ProgressBase,
|
||||
message="whatever")
|
||||
|
||||
# without progress
|
||||
mod.progress_loop(act, [1, 2, 3], None,
|
||||
message="whatever")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue