~dpm/reminders-app/disable-deb-build-tests

« back to all changes in this revision

Viewing changes to tests/autopilot/reminders/tests/__init__.py

  • Committer: Tarmac
  • Author(s): nskaggs
  • Date: 2016-03-08 21:15:42 UTC
  • mfrom: (541.1.7 reminders-app)
  • Revision ID: tarmac-20160308211542-aqdgkkewulktqs6r
AP docs and cleanup.

Approved by Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
186
186
            temp_dir = temp_dir_fixture.path
187
187
            temp_xdg_config_home = os.path.join(temp_dir, '.config')
188
188
 
189
 
            # If running under xvfb, as jenkins does,
190
 
            # xsession will fail to start without xauthority file
191
 
            # Thus if the Xauthority file is in the home directory
192
 
            # make sure we copy it to our temp home directory
193
 
            self._copy_xauthority_file(temp_dir)
194
 
 
195
189
            self.useFixture(
196
190
                fixtures.EnvironmentVariable('HOME', newvalue=temp_dir))
197
191
            self.useFixture(
202
196
 
203
197
            return temp_dir
204
198
 
205
 
    def _copy_xauthority_file(self, directory):
206
 
        """Copy .Xauthority file to directory, if it exists in /home."""
207
 
        xauth = os.path.expanduser(os.path.join('~', '.Xauthority'))
208
 
        if os.path.isfile(xauth):
209
 
            logger.debug("Copying .Xauthority to " + directory)
210
 
            shutil.copyfile(
211
 
                os.path.expanduser(os.path.join('~', '.Xauthority')),
212
 
                os.path.join(directory, '.Xauthority'))
213
 
 
214
199
 
215
200
class RemindersAppTestCase(BaseTestCaseWithTempHome):
216
201