~barry/autopilot/lp1488175

« back to all changes in this revision

Viewing changes to autopilot/tests/unit/test_test_fixtures.py

  • Committer: CI bot
  • Author(s): Leonardo Arias Fonseca, Thomi Richards, Christopher Lee, Leo Arias, nskaggs
  • Date: 2014-10-31 21:49:56 UTC
  • mfrom: (493.1.26 trunk)
  • Revision ID: ps-jenkins@lists.canonical.com-20141031214956-oaptmny2t0vgj973
Autopilot release:
  - Add support for large timestamps
  - Add per-test timeouts
  - Add press duration to touch clicks
  - Improved logging
  - Make own autopilot functional test runnable with testtools runner.   
Approved by: Nicholas Skaggs, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
from autopilot.tests.functional.fixtures import (
21
21
    ExecutableScript,
 
22
    Timezone,
22
23
    TempDesktopFile,
23
24
)
24
25
 
213
214
    def test_creates_file_with_execute_bit_set(self):
214
215
        fixture = self.useFixture(ExecutableScript(script=""))
215
216
        self.assertTrue(os.stat(fixture.path).st_mode & stat.S_IXUSR)
 
217
 
 
218
 
 
219
class TimezoneFixtureTests(TestCase):
 
220
 
 
221
    def test_sets_environment_variable_to_timezone(self):
 
222
        token = self.getUniqueString()
 
223
 
 
224
        self.useFixture(Timezone(token))
 
225
 
 
226
        self.assertEqual(os.environ.get('TZ'), token)
 
227
 
 
228
    def test_resets_timezone_back_to_original(self):
 
229
        original_tz = os.environ.get('TZ', None)
 
230
        token = self.getUniqueString()
 
231
 
 
232
        fixture = self.useFixture(Timezone(token))
 
233
        fixture.cleanUp()
 
234
 
 
235
        self.assertEqual(os.environ.get('TZ', None), original_tz)