=== modified file 'ubuntu_autopilot_tests/fileroller/__init__.py'
--- ubuntu_autopilot_tests/fileroller/__init__.py	2013-05-29 11:56:42 +0000
+++ ubuntu_autopilot_tests/fileroller/__init__.py	2014-03-14 15:38:17 +0000
@@ -1,1 +0,0 @@
-# -*- coding: utf-8 -*-

=== modified file 'ubuntu_autopilot_tests/fileroller/test_fileroller.py'
--- ubuntu_autopilot_tests/fileroller/test_fileroller.py	2013-11-22 22:00:27 +0000
+++ ubuntu_autopilot_tests/fileroller/test_fileroller.py	2014-03-14 15:38:17 +0000
@@ -1,12 +1,20 @@
 from autopilot.testcase import AutopilotTestCase
 from autopilot.matchers import Eventually
-from testtools.matchers import Equals, Contains, NotEquals
+from testtools.matchers import Equals, Contains
+from testtools.matchers import NotEquals, DirExists, FileExists
 from autopilot.input import Mouse, Pointer
 from time import sleep
+import logging
 import os
+try:
+    from unittest import mock
+except ImportError:
+    import mock
 import shutil
 import tempfile
 
+logger = logging.getLogger('__name__')
+
 
 class FileRollerTests(AutopilotTestCase):
     '''Collection of autopilot test for file-roller (Archive Manager) '''
@@ -14,6 +22,10 @@
     def setUp(self):
         '''Set-up method'''
         super(FileRollerTests, self).setUp()
+        #mock out the home dir
+        self.home_dir = self._patch_home()
+
+        #launch the app
         self.app = self.launch_test_application('file-roller')
 
         # only instantiate these once for multiple tests
@@ -32,6 +44,12 @@
         self.new_archive_button = self.app.select_single('GtkToolButton',
                                                          name=u'New')
 
+        #create symbolic link for fast test content location
+        src_dir = '/usr/share/example-content/Ubuntu_Free_Culture_Showcase/'
+        files = os.listdir(src_dir)
+        for f in files:
+            shutil.copyfile(src_dir + str(f), os.getenv("HOME") + '/' + str(f))
+
     def test_create_archive(self):
         '''Creates an archive and adds sample data,
            Window title must contain archive name'''
@@ -103,7 +121,6 @@
         self.keyboard.type(tempArchive)
 
         # TODO: Figure out a gzip commpress, does not have an active Id enabled
-
         # select the create button and check it is clickable
         self.create_button = self.app.select_single('GtkButton',
                                                     label=u'create-archive')
@@ -118,30 +135,24 @@
         self.add_files_dialog = self.app.select_single('FrFileSelectorDialog')
         self.assertThat(self.add_files_dialog.title,
                         Eventually(Equals('Add Files')))
-
         # This is a horrible hacky workaround to add sample
         # files from /usr/share/example-content/*
         # Need to find a better workaround :S Location GtkEntry
         # doesnt work when entering file path
         # Maybe add some assertions to check that the
         # Location GTKEntry contains correct path
+        #first ensure we are in the home directory
+
         self.keyboard.press_and_release("Alt+l")
         self.keyboard.press_and_release("Tab")
         self.keyboard.press_and_release("Tab")
-        self.keyboard.type("File")
-        self.keyboard.press_and_release("Enter")
         self.keyboard.press_and_release("Tab")
-        self.keyboard.press_and_release("Right")
-        self.keyboard.press_and_release("Right")
-        self.keyboard.type("usr")
-        self.keyboard.press_and_release("Enter")
-        self.keyboard.type("share")
-        self.keyboard.press_and_release("Enter")
-        self.keyboard.type("example-content")
-        self.keyboard.press_and_release("Enter")
-        self.keyboard.press_and_release("Left")
-        self.keyboard.press_and_release("Left")
-        self.keyboard.press_and_release("Enter")
+
+        self.keyboard.press_and_release("Space")
+        self.keyboard.press_and_release("Down")
+        self.keyboard.press_and_release("Down")
+        self.keyboard.press_and_release("Space")
+
         # We must be able to click the '_Add' button
         self.add_folder_button = self.app.select_single('GtkLabel',
                                                         label=u'_Add')
@@ -186,6 +197,7 @@
 
         self.keyboard.press_and_release("Alt+l")
         self.keyboard.type(tempArchive)
+        self.keyboard.press_and_release('Enter')
 
         self.extract_archive_button = self.app.select_single(
             'GtkLabel', label=u'_Extract')
@@ -207,6 +219,12 @@
 
         self.pointing_device.move_to_object(self.show_files_button)
         self.pointing_device.click()
+
+        #check the files have actually been extracted
+        self.assertThat(tempArchive, DirExists())
+        self.assertThat(tempArchive + '/' + '/How fast.ogg', FileExists())
+        self.assertThat(tempArchive + '/' + '/Josh Woodward - Swansong.ogg', FileExists())
+
         # This sleep is needed as we can't introspect
         # nautilus when it shows the files
         # TODO: Once nautilus can be introspected we need to lose this sleep
@@ -254,6 +272,25 @@
         extract_path = os.path.join('/tmp/' + fileName)
         self.addCleanup(shutil.rmtree, extract_path)
 
+    def _patch_home(self):
+        #make a temp dir
+        temp_dir = tempfile.mkdtemp()
+        logger.debug("Created fake home directory " + temp_dir)
+        self.addCleanup(shutil.rmtree, temp_dir)
+        #if the Xauthority file is in home directory
+        #make sure we copy it to temp home, otherwise do nothing
+        xauth = os.path.expanduser(os.path.join('~', '.Xauthority'))
+        if os.path.isfile(xauth):
+            logger.debug("Copying .Xauthority to fake home " + temp_dir)
+            shutil.copyfile(
+                os.path.expanduser(os.path.join('~', '.Xauthority')),
+                os.path.join(temp_dir, '.Xauthority'))
+        patcher = mock.patch.dict('os.environ', {'HOME': temp_dir})
+        patcher.start()
+        logger.debug("Patched home to fake home directory " + temp_dir)
+        self.addCleanup(patcher.stop)
+        return temp_dir
+
 
 #hardcoded global archiveName
 def _tempArchiveName():

