Merge lp:~thomir-deactivatedaccount/ubuntu-calendar-app/trunk-fix-ugly-bits into lp:ubuntu-calendar-app

Proposed by Charles Kerr
Status: Rejected
Rejected by: Nicholas Skaggs
Proposed branch: lp:~thomir-deactivatedaccount/ubuntu-calendar-app/trunk-fix-ugly-bits
Merge into: lp:ubuntu-calendar-app
Diff against target: 26 lines (+6/-3)
1 file modified
tests/autopilot/calendar_app/tests/__init__.py (+6/-3)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/ubuntu-calendar-app/trunk-fix-ugly-bits
Reviewer Review Type Date Requested Status
Nicholas Skaggs (community) Disapprove
Review via email: mp+221099@code.launchpad.net

Commit message

Fix tmp directory breakage that occurred in unit test's scaffolding under some conditions.

Description of the change

Fix an error in the __init__.py of calendar_app's autopilot tests. '~' was not being expanded by python into a full path when click_test == true, causing tests to fail with:

File "/home/phablet/autopilot/calendar_app/tests/test_weekview.py", line 31, in setUp
super(TestWeekView, self).setUp()
File "/home/phablet/autopilot/calendar_app/tests/__init__.py", line 69, in setUp
self.home_dir = self._patch_home()
File "/home/phablet/autopilot/calendar_app/tests/__init__.py", line 128, in _patch_home
self.useFixture(temp_dir_fixture)
File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 628, in useFixture
fixture.setUp()
File "/usr/lib/python3/dist-packages/fixtures/_fixtures/tempdir.py", line 44, in setUp
self.path = tempfile.mkdtemp(dir=self.rootdir)
File "/usr/lib/python3.4/tempfile.py", line 434, in mkdtemp
_os.mkdir(file, 0o700)
FileNotFoundError: [Errno 2] No such file or directory: '~/autopilot/fakeenv/tmpy3o03xq5'
}}}

To post a comment you must log in.
Revision history for this message
Charles Kerr (charlesk) wrote :

Looks like Nick's done a separate fix at lp:~nskaggs/ubuntu-calendar-app/fix-ap-env-setup so maybe this isn't necessary anymore.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Sorry, I was out sick for the week. Thanks for the heads up on this and the suggested tweaks!

We've been iterating on getting test isolation going with apparmor; the other mp incorporates some of what's in here, so I'm going to just reject this.

review: Disapprove

Unmerged revisions

292. By Thomi Richards

Fixed bug where '~' was not being expanded, and cleaned up some other code.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/calendar_app/tests/__init__.py'
2--- tests/autopilot/calendar_app/tests/__init__.py 2014-05-23 08:11:57 +0000
3+++ tests/autopilot/calendar_app/tests/__init__.py 2014-05-27 15:06:10 +0000
4@@ -48,8 +48,7 @@
5 else:
6 scenarios = [('with touch', dict(input_device_class=Touch))]
7
8- local_location = os.path.dirname(os.path.dirname(os.getcwd()))
9- local_location_qml = local_location + "/calendar.qml"
10+ local_location_qml = os.path.join(os.getcwd(), '..', '..', 'calendar.qml')
11 installed_location_qml = "/usr/share/calendar-app/calendar.qml"
12
13 def get_launcher_and_type(self):
14@@ -120,7 +119,11 @@
15 #click requires apparmor profile, and writing to special dir
16 #but the desktop can write to a traditional /tmp directory
17 if self.test_type == 'click':
18- temp_dir = os.path.join('~', 'autopilot', 'fakeenv')
19+ temp_dir = os.path.join(
20+ os.path.expanduser('~'),
21+ 'autopilot',
22+ 'fakeenv'
23+ )
24 logger.debug(temp_dir)
25 temp_dir_fixture = fixtures.TempDir(temp_dir)
26 else:

Subscribers

People subscribed via source and target branches

to status/vote changes: