Fix message box tests on OS X.
From the QMessageBox::setWindowTitle docs: On Mac OS X, the window title is ignored (as required by the Mac OS X Guidelines).
This commit is contained in:
parent
5d013a67a7
commit
1e08a6a202
@ -18,6 +18,8 @@
|
||||
|
||||
"""Tests for qutebrowser.misc.msgbox."""
|
||||
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
from qutebrowser.misc import msgbox
|
||||
@ -38,6 +40,7 @@ def test_attributes(qtbot):
|
||||
box = msgbox.msgbox(parent=parent, title=title, text=text, icon=icon,
|
||||
buttons=buttons)
|
||||
qtbot.add_widget(box)
|
||||
if sys.platform != 'darwin':
|
||||
assert box.windowTitle() == title
|
||||
assert box.icon() == icon
|
||||
assert box.standardButtons() == buttons
|
||||
@ -80,6 +83,7 @@ def test_finished_signal(qtbot):
|
||||
def test_information(qtbot):
|
||||
box = msgbox.information(parent=None, title='foo', text='bar')
|
||||
qtbot.add_widget(box)
|
||||
if sys.platform != 'darwin':
|
||||
assert box.windowTitle() == 'foo'
|
||||
assert box.text() == 'bar'
|
||||
assert box.icon() == QMessageBox.Information
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
"""Tests for qutebrowser.utils.error."""
|
||||
|
||||
import sys
|
||||
import collections
|
||||
import logging
|
||||
|
||||
@ -60,6 +61,7 @@ def test_err_windows(qtbot, qapp, pre_text, post_text, expected):
|
||||
w = qapp.activeModalWidget()
|
||||
try:
|
||||
qtbot.add_widget(w)
|
||||
if sys.platform != 'darwin':
|
||||
assert w.windowTitle() == 'title'
|
||||
assert w.icon() == QMessageBox.Critical
|
||||
assert w.standardButtons() == QMessageBox.Ok
|
||||
|
Loading…
Reference in New Issue
Block a user