@@ -25,12 +25,18 @@ from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
26from autopilot.matchers import Eventually
26from autopilot.matchers import Eventually
27from autopilot.platform import model
27from autopilot.platform import model
28from testtools import skipUnless
29from testtools import skipUnless
29from testtools.matchers import Equals
30from testtools.matchers import Equals
30import logging
31import logging
32logger = logging.getLogger(__name__)
33logger = logging.getLogger(__name__)
35+# py2 compatible alias for py3
36+if sys.version >= '3':
34class TestLockscreen(UnityTestCase):
40class TestLockscreen(UnityTestCase):
36 """Tests for the lock screen."""
42 """Tests for the lock screen."""
@@ -123,7 +129,7 @@ class TestLockscreen(UnityTestCase):
126− if not isinstance(code, str):
132+ if not isinstance(code, basestring):
127 raise TypeError(
133 raise TypeError(
128 "'code' parameter must be a string, not %r."
134 "'code' parameter must be a string, not %r."
129 % type(passphrase)
135 % type(passphrase)
@@ -143,7 +149,7 @@ class TestLockscreen(UnityTestCase):
143 :raises: TypeError if passphrase is not a string.
149 :raises: TypeError if passphrase is not a string.
146− if not isinstance(passphrase, str):
152+ if not isinstance(passphrase, basestring):
147 raise TypeError(
153 raise TypeError(
148 "'passphrase' parameter must be a string, not %r."
154 "'passphrase' parameter must be a string, not %r."
149 % type(passphrase)
155 % type(passphrase)
@@ -165,7 +171,7 @@ class TestLockscreen(UnityTestCase):
165 :raises: TypeError if passphrase is not a string.
171 :raises: TypeError if passphrase is not a string.
168− if not isinstance(passphrase, str):
174+ if not isinstance(passphrase, basestring):
169 raise TypeError(
175 raise TypeError(
170 "'passphrase' parameter must be a string, not %r."
176 "'passphrase' parameter must be a string, not %r."
171 % type(passphrase)
177 % type(passphrase)