Merge lp:~nskaggs/ubuntu-filemanager-app/fix-xauthority into lp:ubuntu-filemanager-app

Proposed by Nicholas Skaggs
Status: Merged
Approved by: Nicholas Skaggs
Approved revision: no longer in the source branch.
Merged at revision: 62
Proposed branch: lp:~nskaggs/ubuntu-filemanager-app/fix-xauthority
Merge into: lp:ubuntu-filemanager-app
Diff against target: 22 lines (+8/-3)
1 file modified
tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py (+8/-3)
To merge this branch: bzr merge lp:~nskaggs/ubuntu-filemanager-app/fix-xauthority
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Michael Spencer Approve
Review via email: mp+184681@code.launchpad.net

Commit message

Fix Xauthority errors stemming from home copy during testing

Description of the change

Fix Xauthority errors stemming from home copy during testing

To post a comment you must log in.
Revision history for this message
Michael Spencer (ibelieve) :
review: Approve
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

I'd like confirmation this works on someone else's desktop if possible. It works for me on the manta and my desktop. Assuming the vm passes, I'd appreciate input that it also runs on another desktop.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
62. By Nicholas Skaggs

Fix Xauthority errors stemming from home copy during testing. Fixes: https://bugs.launchpad.net/bugs/1220607.

Approved by Ubuntu Phone Apps Jenkins Bot, Michael Spencer.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py'
2--- tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py 2013-09-05 05:22:47 +0000
3+++ tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py 2013-09-09 21:38:31 +0000
4@@ -42,10 +42,15 @@
5 self.main_view.visible, Eventually(Equals(True)))
6
7 def _patch_home(self):
8+ #create a temporary home for testing purposes
9 temp_dir = tempfile.mkdtemp()
10- shutil.copyfile(
11- os.path.expanduser(os.path.join('~', '.Xauthority')),
12- os.path.join(temp_dir, '.Xauthority'))
13+ #if the Xauthority file is in home directory
14+ #make sure we copy it to temp home, otherwise do nothing
15+ xauth = os.path.expanduser(os.path.join('~', '.Xauthority'))
16+ if os.path.isfile(xauth):
17+ shutil.copyfile(
18+ os.path.expanduser(os.path.join('~', '.Xauthority')),
19+ os.path.join(temp_dir, '.Xauthority'))
20 self.addCleanup(shutil.rmtree, temp_dir)
21 patcher = mock.patch.dict('os.environ', {'HOME': temp_dir})
22 patcher.start()

Subscribers

People subscribed via source and target branches