~carla-sella/ubuntu-docviewer-app/remove-single-file

« back to all changes in this revision

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

  • Committer: carla-sella
  • Date: 2015-06-02 19:37:41 UTC
  • mfrom: (146.1.1 ubuntu-docviewer-app)
  • Revision ID: carla.sella@gmail.com-20150602193741-t521z7mv43n6t1lu
First part of remove file test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
from autopilot.introspection import dbus
24
24
import ubuntuuitoolkit
 
25
import os
 
26
import shutil
25
27
 
26
28
 
27
29
class DocviewerException(ubuntuuitoolkit.ToolkitException):
81
83
        go_button = self.wait_select_single("Button", objectName="GOButton")
82
84
        self.pointing_device.click_object(go_button)
83
85
 
84
 
    @autopilot_logging.log_action(logger.info)
 
86
 
85
87
    def click_go_to_page_button(self):
86
88
        """Click the go_to_page header button."""
87
89
        header = self.get_header()
88
90
        header.click_action_button('gotopage')
89
91
 
 
92
    @autopilot_logging.log_action(logger.info)
 
93
    def copy_files_to_fake_home(self, fake_home):
 
94
        files_dir = os.path.join(os.path.dirname(__file__), 'files')
 
95
        files = os.listdir(files_dir)
 
96
        return len(files)
 
97
        for file_name in files:
 
98
            shutil.copy(os.path.join(files_dir, file_name), fake_home)
90
99
 
91
100
class Page(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
92
101