~nick-dedekind/unity8/indicators.hint-interval

« back to all changes in this revision

Viewing changes to tests/autopilot/unity8/shell/tests/test_lock_screen.py

  • Committer: Nick Dedekind
  • Date: 2014-03-07 15:54:57 UTC
  • mfrom: (638.1.118 unity8)
  • Revision ID: nicholas.dedekind@gmail.com-20140307155457-f0s1zu5ll2czt3rq
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
from autopilot.matchers import Eventually
28
28
from autopilot.platform import model
 
29
import sys
29
30
from testtools import skipUnless
30
31
from testtools.matchers import Equals
31
32
import logging
32
33
 
33
34
logger = logging.getLogger(__name__)
34
35
 
 
36
# py2 compatible alias for py3
 
37
if sys.version >= '3':
 
38
    basestring = str
 
39
 
 
40
 
35
41
class TestLockscreen(UnityTestCase):
36
42
 
37
43
    """Tests for the lock screen."""
125
131
        """
126
132
 
127
133
        if not isinstance(code, basestring):
128
 
            raise TypeError("'code' parameter must be a string.")
 
134
            raise TypeError(
 
135
                "'code' parameter must be a string, not %r."
 
136
                % type(passphrase)
 
137
            )
129
138
        for num in code:
130
139
            if not num.isdigit():
131
140
                raise ValueError(
142
151
 
143
152
        """
144
153
        if not isinstance(passphrase, basestring):
145
 
            raise TypeError("'passphrase' parameter must be a string.")
 
154
            raise TypeError(
 
155
                "'passphrase' parameter must be a string, not %r."
 
156
                % type(passphrase)
 
157
            )
146
158
 
147
159
        pinentryField = self.main_window.get_pinentryField()
148
160
        self.touch.tap_object(pinentryField)
161
173
 
162
174
        """
163
175
        if not isinstance(passphrase, basestring):
164
 
            raise TypeError("'passphrase' parameter must be a string.")
 
176
            raise TypeError(
 
177
                "'passphrase' parameter must be a string, not %r."
 
178
                % type(passphrase)
 
179
            )
165
180
 
166
181
        prompt = self.main_window.get_greeter().get_prompt()
167
182
        self.touch.tap_object(prompt)