summaryrefslogtreecommitdiff
path: root/tests/unit/misc
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-07-12 13:45:12 +0200
committerFlorian Bruhin <me@the-compiler.org>2020-07-12 13:45:12 +0200
commitb6d2dbb1dcc6ca3e0044576b6a8ee36d61c10268 (patch)
tree69dab0fcf7f8659d9d45d98bd27a7a1af49e6f76 /tests/unit/misc
parent359a9c7dfb0bb1c3c4cadf9bcfac89aeb102e05c (diff)
downloadqutebrowser-b6d2dbb1dcc6ca3e0044576b6a8ee36d61c10268.tar.gz
qutebrowser-b6d2dbb1dcc6ca3e0044576b6a8ee36d61c10268.zip
Add a :devtools-focus command
Diffstat (limited to 'tests/unit/misc')
-rw-r--r--tests/unit/misc/test_miscwidgets.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/unit/misc/test_miscwidgets.py b/tests/unit/misc/test_miscwidgets.py
index c31c53373..7568e56c0 100644
--- a/tests/unit/misc/test_miscwidgets.py
+++ b/tests/unit/misc/test_miscwidgets.py
@@ -158,7 +158,8 @@ class TestInspectorSplitter:
@pytest.fixture
def splitter(self, qtbot, fake_webview):
- inspector_splitter = miscwidgets.InspectorSplitter(fake_webview)
+ inspector_splitter = miscwidgets.InspectorSplitter(
+ win_id=0, main_webview=fake_webview)
qtbot.add_widget(inspector_splitter)
return inspector_splitter
@@ -171,6 +172,11 @@ class TestInspectorSplitter:
splitter.show()
splitter.resize(800, 600)
+ def test_cycle_focus_no_inspector(self, splitter):
+ with pytest.raises(inspector.Error,
+ match='No inspector inside main window'):
+ splitter.cycle_focus()
+
@pytest.mark.parametrize(
'position, orientation, inspector_idx, webview_idx', [
(inspector.Position.left, Qt.Horizontal, 0, 1),
@@ -192,6 +198,14 @@ class TestInspectorSplitter:
assert splitter.orientation() == orientation
+ def test_cycle_focus_hidden_inspector(self, splitter, fake_inspector):
+ splitter.set_inspector(fake_inspector, inspector.Position.right)
+ splitter.show()
+ fake_inspector.hide()
+ with pytest.raises(inspector.Error,
+ match='No inspector inside main window'):
+ splitter.cycle_focus()
+
@pytest.mark.parametrize(
'config, width, height, position, expected_size', [
# No config but enough big window