Merge lp:~canonical-platform-qa/gallery-app/fix1381207-do_not_touch_database into lp:~canonical-platform-qa/gallery-app/clean_autopilot_setup

Proposed by Leonardo Arias Fonseca
Status: Needs review
Proposed branch: lp:~canonical-platform-qa/gallery-app/fix1381207-do_not_touch_database
Merge into: lp:~canonical-platform-qa/gallery-app/clean_autopilot_setup
Prerequisite: lp:~canonical-platform-qa/gallery-app/fix1376423-no_backup
Diff against target: 77 lines (+2/-28)
1 file modified
tests/autopilot/gallery_app/tests/__init__.py (+2/-28)
To merge this branch: bzr merge lp:~canonical-platform-qa/gallery-app/fix1381207-do_not_touch_database
Reviewer Review Type Date Requested Status
Canonical Platform QA Team Pending
Review via email: mp+238386@code.launchpad.net

Commit message

During the autopilot tests, do not touch the app databases and do not touch the thumbnails.

To post a comment you must log in.
1107. By Leonardo Arias Fonseca

Link to the bug

1108. By Leonardo Arias Fonseca

Removed the database and thumbnail files.

Unmerged revisions

1108. By Leonardo Arias Fonseca

Removed the database and thumbnail files.

1107. By Leonardo Arias Fonseca

Link to the bug

1106. By Leonardo Arias Fonseca

Modified the date of the first two pictures.

1105. By Leonardo Arias Fonseca

Merged with prerequisite.

1104. By Leonardo Arias Fonseca

Removed the database edits.

1103. By Leonardo Arias Fonseca

Merged with prerequisite.

1102. By Leonardo Arias Fonseca

Do not backup existing files during autopilot tests. We will assume a clean environment from now on.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed directory 'tests/autopilot/gallery_app/data/default/.database'
2=== removed file 'tests/autopilot/gallery_app/data/default/.database/gallery.sqlite'
3Binary files tests/autopilot/gallery_app/data/default/.database/gallery.sqlite 2014-03-10 10:28:51 +0000 and tests/autopilot/gallery_app/data/default/.database/gallery.sqlite 1970-01-01 00:00:00 +0000 differ
4=== removed file 'tests/autopilot/gallery_app/data/default/.database/gallery_confined.sqlite'
5Binary files tests/autopilot/gallery_app/data/default/.database/gallery_confined.sqlite 2014-04-08 16:57:25 +0000 and tests/autopilot/gallery_app/data/default/.database/gallery_confined.sqlite 1970-01-01 00:00:00 +0000 differ
6=== removed directory 'tests/autopilot/gallery_app/data/default/.thumbnails'
7=== removed directory 'tests/autopilot/gallery_app/data/default/.thumbnails/preview'
8=== removed file 'tests/autopilot/gallery_app/data/default/.thumbnails/preview/b117f754f46e254a434a73c9f4501853.jpg'
9Binary files tests/autopilot/gallery_app/data/default/.thumbnails/preview/b117f754f46e254a434a73c9f4501853.jpg 2013-06-04 10:31:43 +0000 and tests/autopilot/gallery_app/data/default/.thumbnails/preview/b117f754f46e254a434a73c9f4501853.jpg 1970-01-01 00:00:00 +0000 differ
10=== removed file 'tests/autopilot/gallery_app/data/default/.thumbnails/preview/e3034181bd65a2f1b1e8fa3ec1961bed.jpg'
11Binary files tests/autopilot/gallery_app/data/default/.thumbnails/preview/e3034181bd65a2f1b1e8fa3ec1961bed.jpg 2013-06-04 10:31:43 +0000 and tests/autopilot/gallery_app/data/default/.thumbnails/preview/e3034181bd65a2f1b1e8fa3ec1961bed.jpg 1970-01-01 00:00:00 +0000 differ
12=== removed directory 'tests/autopilot/gallery_app/data/default/.thumbnails/square'
13=== removed file 'tests/autopilot/gallery_app/data/default/.thumbnails/square/b117f754f46e254a434a73c9f4501853.jpg'
14Binary files tests/autopilot/gallery_app/data/default/.thumbnails/square/b117f754f46e254a434a73c9f4501853.jpg 2013-06-04 10:31:43 +0000 and tests/autopilot/gallery_app/data/default/.thumbnails/square/b117f754f46e254a434a73c9f4501853.jpg 1970-01-01 00:00:00 +0000 differ
15=== removed file 'tests/autopilot/gallery_app/data/default/.thumbnails/square/e3034181bd65a2f1b1e8fa3ec1961bed.jpg'
16Binary files tests/autopilot/gallery_app/data/default/.thumbnails/square/e3034181bd65a2f1b1e8fa3ec1961bed.jpg 2013-06-04 10:31:43 +0000 and tests/autopilot/gallery_app/data/default/.thumbnails/square/e3034181bd65a2f1b1e8fa3ec1961bed.jpg 1970-01-01 00:00:00 +0000 differ
17=== modified file 'tests/autopilot/gallery_app/data/default/sample01.jpg'
18Binary files tests/autopilot/gallery_app/data/default/sample01.jpg 2013-06-18 07:56:00 +0000 and tests/autopilot/gallery_app/data/default/sample01.jpg 2014-10-15 05:07:15 +0000 differ
19=== modified file 'tests/autopilot/gallery_app/data/default/sample02.jpg'
20Binary files tests/autopilot/gallery_app/data/default/sample02.jpg 2013-06-18 07:56:00 +0000 and tests/autopilot/gallery_app/data/default/sample02.jpg 2014-10-15 05:07:15 +0000 differ
21=== modified file 'tests/autopilot/gallery_app/tests/__init__.py'
22--- tests/autopilot/gallery_app/tests/__init__.py 2014-10-15 05:07:15 +0000
23+++ tests/autopilot/gallery_app/tests/__init__.py 2014-10-15 05:07:15 +0000
24@@ -49,10 +49,6 @@
25 tap_press_time = 1
26 local_location = os.path.abspath('../../src/gallery-app')
27
28- _db = '~/.local/share/com.ubuntu.gallery/' \
29- 'database/gallery.sqlite'
30- _thumbs = '~/.cache/com.ubuntu.gallery/thumbnails'
31-
32 ARGS = []
33
34 @property
35@@ -78,21 +74,6 @@
36 def _get_sample_destination_dir(self):
37 return os.path.expanduser("~/Pictures")
38
39- def configure_db(self):
40- db = os.path.expanduser(self._db)
41- if not os.path.exists(os.path.dirname(db)):
42- os.makedirs(os.path.dirname(db))
43- mock_db = os.path.join(self.sample_destination_dir, '.database',
44- 'gallery_confined.sqlite')
45- shutil.move(mock_db, db)
46-
47- def configure_thumbnails(self):
48- thumbs = os.path.expanduser(self._thumbs)
49- if not os.path.exists(os.path.dirname(thumbs)):
50- os.makedirs(os.path.dirname(thumbs))
51- mock_thumbs = os.path.join(self.sample_destination_dir, '.thumbnails')
52- shutil.move(mock_thumbs, thumbs)
53-
54 def configure_sample_files(self, env_type):
55 self.sample_dir = resource_filename('gallery_app', 'data')
56 self.sample_destination_dir = self._get_sample_destination_dir()
57@@ -105,18 +86,11 @@
58 "sample04.jpg"
59 )
60
61- default_data_dir = os.path.join(
62- self.sample_dir,
63- "default")
64+ default_data_dir = os.path.join(self.sample_dir, 'default')
65 shutil.copytree(default_data_dir, self.sample_destination_dir)
66 self.assertTrue(os.path.isfile(self.sample_file))
67
68- self.sample_file_source = \
69- default_data_dir + self.sample_file_source
70-
71- if env_type is fixture_setup.Launcher.installed_click:
72- self.configure_db()
73- self.configure_thumbnails()
74+ self.sample_file_source = default_data_dir + self.sample_file_source
75
76 def do_reset_config(self):
77 config = os.path.expanduser(

Subscribers

People subscribed via source and target branches

to all changes: