~fboucault/camera-app/fix_header_flickering_arale

« back to all changes in this revision

Viewing changes to tests/autopilot/camera_app/tests/test_capture.py

  • Committer: CI Train Bot
  • Author(s): Ugo Riboni
  • Date: 2015-03-13 00:41:42 UTC
  • mfrom: (521.1.16 fix-test)
  • Revision ID: ci-train-bot@canonical.com-20150313004142-0lt05je7d0kh0o6l
Refactor camera editor tests, make them work even if UI extras are not installed, and add a test for the edit button being disabled when on a video
Approved by: Florian Boucault

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    def setUp(self):
29
29
        # Remove configuration file where knowledge of the photo roll hint's necessity is stored
30
30
        config_file = os.path.expanduser("~/.config/com.ubuntu.camera/com.ubuntu.camera.conf")
31
 
        os.remove(config_file)
 
31
        if os.path.exists(config_file):
 
32
            os.remove(config_file)
32
33
 
33
34
        super(TestCapture, self).setUp()
34
35
 
199
200
    def delete_all_photos(self):
200
201
        picture_files = os.listdir(self.pictures_dir)
201
202
        for f in picture_files:
202
 
            os.remove(os.path.join(self.pictures_dir, f))
 
203
            f = os.path.join(self.pictures_dir, f)
 
204
            if os.path.isfile(f):
 
205
                os.remove(os.path.join(self.pictures_dir, f))
203
206
 
204
207
    def get_first_picture(self, timeout=10):
205
208
        pictures = []