diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-01-14 11:59:58 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-01-14 12:05:38 +0100 |
commit | f1b925e37fea016939a35126bfc29a0c3e2d547b (patch) | |
tree | bc47c3656e084fbb07c5c62311b7402360735668 /tests/unit/browser/test_history.py | |
parent | 5526dce6c36042f711cdb80f6b1b342cd6b0628c (diff) | |
download | qutebrowser-f1b925e37fea016939a35126bfc29a0c3e2d547b.tar.gz qutebrowser-f1b925e37fea016939a35126bfc29a0c3e2d547b.zip |
history: Simplify HistoryProgress
It doesn't actually need to be reusable, also make sure it's cleaned up
when unneeded.
Diffstat (limited to 'tests/unit/browser/test_history.py')
-rw-r--r-- | tests/unit/browser/test_history.py | 51 |
1 files changed, 19 insertions, 32 deletions
diff --git a/tests/unit/browser/test_history.py b/tests/unit/browser/test_history.py index 876ffb9bc..1aa873503 100644 --- a/tests/unit/browser/test_history.py +++ b/tests/unit/browser/test_history.py @@ -498,35 +498,22 @@ class TestCompletionMetaInfo: assert metainfo['excluded_patterns'] == value -class TestHistoryProgress: - - @pytest.fixture - def progress(self): - return history.HistoryProgress() - - def test_no_start(self, progress): - """Test calling tick/finish without start.""" - progress.tick() - assert progress._value == 1 - progress.finish() - assert progress._progress is None - assert progress._value == 0 - - def test_gui(self, qtbot, progress): - progress.start("Hello World") - dialog = progress._progress - qtbot.add_widget(dialog) - progress.tick() - - assert dialog.isVisible() - assert dialog.labelText() == "Hello World" - assert dialog.minimum() == 0 - assert dialog.value() == 1 - assert dialog.minimumDuration() == 0 - - assert dialog.maximum() == 0 - progress.set_maximum(42) - assert dialog.maximum() == 42 - - progress.finish() - assert not dialog.isVisible() +def test_history_progress(qtbot): + progress = history.HistoryProgress() + progress.start("Hello World") + dialog = progress._progress + qtbot.add_widget(dialog) + progress.tick() + + assert dialog.isVisible() + assert dialog.labelText() == "Hello World" + assert dialog.minimum() == 0 + assert dialog.value() == 1 + assert dialog.minimumDuration() == 0 + + assert dialog.maximum() == 0 + progress.set_maximum(42) + assert dialog.maximum() == 42 + + progress.finish() + assert not dialog.isVisible() |