summaryrefslogtreecommitdiff
path: root/tests/unit/browser/test_history.py
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2018-09-06 17:23:39 +0200
committerFlorian Bruhin <me@the-compiler.org>2018-09-06 17:26:28 +0200
commit935d93d10e757a347d7f5e94d369ea6773b456c5 (patch)
tree2a78aca4b6c2048434c90702cd0657dc69864949 /tests/unit/browser/test_history.py
parent9a6c8fe1b98095500c03b4476f761541889becfe (diff)
downloadqutebrowser-935d93d10e757a347d7f5e94d369ea6773b456c5.tar.gz
qutebrowser-935d93d10e757a347d7f5e94d369ea6773b456c5.zip
Add tests for HistoryProgress
Diffstat (limited to 'tests/unit/browser/test_history.py')
-rw-r--r--tests/unit/browser/test_history.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/unit/browser/test_history.py b/tests/unit/browser/test_history.py
index 40dce3ec4..ce02cff9b 100644
--- a/tests/unit/browser/test_history.py
+++ b/tests/unit/browser/test_history.py
@@ -468,3 +468,32 @@ class TestCompletionMetaInfo:
assert not metainfo['force_rebuild']
metainfo['force_rebuild'] = True
assert metainfo['force_rebuild']
+
+
+class TestHistoryProgress:
+
+ @pytest.fixture
+ def progress(self):
+ return history.HistoryProgress()
+
+ def test_no_start(self, progress):
+ """Test calling tick/finish without start."""
+ progress.tick()
+ progress.finish()
+ assert progress._progress is None
+ assert progress._value == 1
+
+ def test_gui(self, qtbot, progress):
+ progress.start("Hello World", 42)
+ dialog = progress._progress
+ qtbot.add_widget(dialog)
+ progress.tick()
+
+ assert dialog.isVisible()
+ assert dialog.labelText() == "Hello World"
+ assert dialog.minimum() == 0
+ assert dialog.maximum() == 42
+ assert dialog.value() == 1
+
+ progress.finish()
+ assert not dialog.isVisible()