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."""
|
"""Tests for qutebrowser.misc.msgbox."""
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from qutebrowser.misc import msgbox
|
from qutebrowser.misc import msgbox
|
||||||
@ -38,7 +40,8 @@ def test_attributes(qtbot):
|
|||||||
box = msgbox.msgbox(parent=parent, title=title, text=text, icon=icon,
|
box = msgbox.msgbox(parent=parent, title=title, text=text, icon=icon,
|
||||||
buttons=buttons)
|
buttons=buttons)
|
||||||
qtbot.add_widget(box)
|
qtbot.add_widget(box)
|
||||||
assert box.windowTitle() == title
|
if sys.platform != 'darwin':
|
||||||
|
assert box.windowTitle() == title
|
||||||
assert box.icon() == icon
|
assert box.icon() == icon
|
||||||
assert box.standardButtons() == buttons
|
assert box.standardButtons() == buttons
|
||||||
assert box.text() == text
|
assert box.text() == text
|
||||||
@ -80,6 +83,7 @@ def test_finished_signal(qtbot):
|
|||||||
def test_information(qtbot):
|
def test_information(qtbot):
|
||||||
box = msgbox.information(parent=None, title='foo', text='bar')
|
box = msgbox.information(parent=None, title='foo', text='bar')
|
||||||
qtbot.add_widget(box)
|
qtbot.add_widget(box)
|
||||||
assert box.windowTitle() == 'foo'
|
if sys.platform != 'darwin':
|
||||||
|
assert box.windowTitle() == 'foo'
|
||||||
assert box.text() == 'bar'
|
assert box.text() == 'bar'
|
||||||
assert box.icon() == QMessageBox.Information
|
assert box.icon() == QMessageBox.Information
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
"""Tests for qutebrowser.utils.error."""
|
"""Tests for qutebrowser.utils.error."""
|
||||||
|
|
||||||
|
import sys
|
||||||
import collections
|
import collections
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@ -60,7 +61,8 @@ def test_err_windows(qtbot, qapp, pre_text, post_text, expected):
|
|||||||
w = qapp.activeModalWidget()
|
w = qapp.activeModalWidget()
|
||||||
try:
|
try:
|
||||||
qtbot.add_widget(w)
|
qtbot.add_widget(w)
|
||||||
assert w.windowTitle() == 'title'
|
if sys.platform != 'darwin':
|
||||||
|
assert w.windowTitle() == 'title'
|
||||||
assert w.icon() == QMessageBox.Critical
|
assert w.icon() == QMessageBox.Critical
|
||||||
assert w.standardButtons() == QMessageBox.Ok
|
assert w.standardButtons() == QMessageBox.Ok
|
||||||
assert w.text() == expected
|
assert w.text() == expected
|
||||||
|
Loading…
Reference in New Issue
Block a user