Fix tests on OS X, take three.
This commit is contained in:
parent
81ba49e79b
commit
54eae77328
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
"""Tests for BaseKeyParser."""
|
"""Tests for BaseKeyParser."""
|
||||||
|
|
||||||
|
import sys
|
||||||
import logging
|
import logging
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
@ -131,8 +132,12 @@ class TestSpecialKeys:
|
|||||||
|
|
||||||
def test_valid_key(self, fake_keyevent_factory):
|
def test_valid_key(self, fake_keyevent_factory):
|
||||||
"""Test a valid special keyevent."""
|
"""Test a valid special keyevent."""
|
||||||
self.kp.handle(fake_keyevent_factory(Qt.Key_A, Qt.ControlModifier))
|
if sys.platform == 'darwin':
|
||||||
self.kp.handle(fake_keyevent_factory(Qt.Key_X, Qt.ControlModifier))
|
modifier = Qt.MetaModifier
|
||||||
|
else:
|
||||||
|
modifier = Qt.ControlModifier
|
||||||
|
self.kp.handle(fake_keyevent_factory(Qt.Key_A, modifier))
|
||||||
|
self.kp.handle(fake_keyevent_factory(Qt.Key_X, modifier))
|
||||||
self.kp.execute.assert_called_once_with('ctrla', self.kp.Type.special)
|
self.kp.execute.assert_called_once_with('ctrla', self.kp.Type.special)
|
||||||
|
|
||||||
def test_invalid_key(self, fake_keyevent_factory):
|
def test_invalid_key(self, fake_keyevent_factory):
|
||||||
@ -167,8 +172,12 @@ class TestKeyChain:
|
|||||||
|
|
||||||
def test_valid_special_key(self, fake_keyevent_factory):
|
def test_valid_special_key(self, fake_keyevent_factory):
|
||||||
"""Test valid special key."""
|
"""Test valid special key."""
|
||||||
self.kp.handle(fake_keyevent_factory(Qt.Key_A, Qt.ControlModifier))
|
if sys.platform == 'darwin':
|
||||||
self.kp.handle(fake_keyevent_factory(Qt.Key_X, Qt.ControlModifier))
|
modifier = Qt.MetaModifier
|
||||||
|
else:
|
||||||
|
modifier = Qt.ControlModifier
|
||||||
|
self.kp.handle(fake_keyevent_factory(Qt.Key_A, modifier))
|
||||||
|
self.kp.handle(fake_keyevent_factory(Qt.Key_X, modifier))
|
||||||
self.kp.execute.assert_called_once_with('ctrla', self.kp.Type.special)
|
self.kp.execute.assert_called_once_with('ctrla', self.kp.Type.special)
|
||||||
assert self.kp._keystring == ''
|
assert self.kp._keystring == ''
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user