Merge lp:~osomon/notes-app/manually-create-db into lp:notes-app

Proposed by Olivier Tilloy
Status: Rejected
Rejected by: Olivier Tilloy
Proposed branch: lp:~osomon/notes-app/manually-create-db
Merge into: lp:notes-app
Diff against target: 342 lines (+51/-106)
7 files modified
tests/autopilot/notes_app/tests/__init__.py (+28/-50)
tests/autopilot/notes_app/tests/test_create.py (+3/-9)
tests/autopilot/notes_app/tests/test_delete.py (+3/-9)
tests/autopilot/notes_app/tests/test_expand_collapse.py (+3/-9)
tests/autopilot/notes_app/tests/test_images.py (+3/-9)
tests/autopilot/notes_app/tests/test_parts.py (+3/-3)
tests/autopilot/notes_app/tests/test_quit.py (+8/-17)
To merge this branch: bzr merge lp:~osomon/notes-app/manually-create-db
Reviewer Review Type Date Requested Status
Olivier Tilloy Disapprove
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+193097@code.launchpad.net

Commit message

Manually create the notes database before starting tests,
instead of launching the app, quitting it, and launching it again.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:219
http://jenkins.qa.ubuntu.com/job/notes-app-ci/222/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/159
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/153/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-amd64-ci/4
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-armhf-ci/4
        deb: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-armhf-ci/4/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-i386-ci/4
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/150
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/159
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/159/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/153
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/153/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2777/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2827/console
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/594
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/593

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/notes-app-ci/222/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:219
http://jenkins.qa.ubuntu.com/job/notes-app-ci/223/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/161
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/155/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-amd64-ci/5
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-armhf-ci/5
        deb: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-armhf-ci/5/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-i386-ci/5
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/152
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/161
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/161/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/155
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/155/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2779/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2830/console
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/598
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/597

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/notes-app-ci/223/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:219
http://jenkins.qa.ubuntu.com/job/notes-app-ci/224/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/163
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/157/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-amd64-ci/6
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-armhf-ci/6
        deb: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-armhf-ci/6/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-i386-ci/6
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/154
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/163
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/163/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/157
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/157/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2781/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2832/console
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/602
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/601

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/notes-app-ci/224/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:219
http://jenkins.qa.ubuntu.com/job/notes-app-ci/225/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/170
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/164/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-amd64-ci/7
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-armhf-ci/7
        deb: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-armhf-ci/7/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-i386-ci/7
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/160
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/170
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/170/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/164
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/164/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2786/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2838/console
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/611
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/613

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/notes-app-ci/225/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:219
http://jenkins.qa.ubuntu.com/job/notes-app-ci/226/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/172
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/166/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-amd64-ci/8
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-armhf-ci/8
        deb: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-armhf-ci/8/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-i386-ci/8
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/162
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/172
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/172/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/166
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/166/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2789/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2839/console
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/618
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/616

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/notes-app-ci/226/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:219
http://jenkins.qa.ubuntu.com/job/notes-app-ci/227/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/176
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/170/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-amd64-ci/9
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-armhf-ci/9
        deb: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-armhf-ci/9/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/notes-app-trusty-i386-ci/9
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/165
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/176
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/176/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/170
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/170/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2793/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2844/console
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/626
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/625

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/notes-app-ci/227/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :
review: Disapprove

Unmerged revisions

219. By Olivier Tilloy

Remove the DatabaseMixin helper class.

218. By Olivier Tilloy

Manually create the notes database before starting tests,
instead of launching the app, quitting it, and launching it again.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/notes_app/tests/__init__.py'
2--- tests/autopilot/notes_app/tests/__init__.py 2013-10-08 21:50:29 +0000
3+++ tests/autopilot/notes_app/tests/__init__.py 2013-10-29 16:46:19 +0000
4@@ -8,10 +8,13 @@
5 """notes-app autopilot tests."""
6
7 import BaseHTTPServer
8+import base64
9+import glob
10+import md5
11+import os
12 import os.path
13-import glob
14+import sqlite3
15 import threading
16-import base64
17
18 from autopilot.input import Mouse, Touch, Pointer
19 from autopilot.matchers import Eventually
20@@ -82,17 +85,29 @@
21 "com.ubuntu.notes",
22 emulator_base=UbuntuUIToolkitEmulatorBase)
23
24- def launch_and_quit_app(self):
25- self.launch_app()
26- self.main_window.visible.wait_for(True)
27-
28- # When calling launch_app an instance of the spawned process
29- # control object will be stored in self.app.process, and a cleanup
30- # handler will be registered that essentially kills the process.
31- # Therefore, by triggering the cleanup handler here we're killing the
32- # process and removing the handler, which allows a clean launch of
33- # the process during regular test setup.
34- self.doCleanups()
35+ def ensure_db(self):
36+ path = os.path.expanduser("~/.local/share/com.ubuntu.notes/Databases")
37+ if not os.path.exists(path):
38+ os.makedirs(path)
39+ filepath = os.path.join(path, md5.md5("notes").hexdigest())
40+ ini = filepath + ".ini"
41+ if not os.path.exists(ini):
42+ with open(ini, "w") as f:
43+ f.write("""[General]
44+Description=Notes database
45+Driver=QSQLITE
46+EstimatedSize=3145728
47+Name=notes
48+Version=1
49+""")
50+ sql = filepath + ".sqlite"
51+ connection = sqlite3.connect(sql)
52+ cursor = connection.cursor()
53+ cursor.execute("CREATE TABLE IF NOT EXISTS notes "
54+ "(id INTEGER PRIMARY KEY, date DATETIME, note TEXT)")
55+ connection.commit()
56+ connection.close()
57+ return sql
58
59 def assert_osk_eventually_shown(self):
60 if model() != 'Desktop':
61@@ -176,40 +191,3 @@
62 def tearDown(self):
63 super(NotesTestCaseBaseWithHTTPServer, self).tearDown()
64 self.server.shutdown()
65-
66-
67-class DatabaseMixin(object):
68-
69- """
70- Helper functions for dealing with sqlite databases
71- """
72-
73- def _get_db_path(self):
74- db_path_list = [
75- "~/.local/share/com.ubuntu.notes/Databases",
76- "~/.local/share/Qt Project/QtQmlViewer/QML/OfflineStorage/"
77- "Databases/"]
78- for path in db_path_list:
79- path = os.path.expanduser(path)
80- if os.path.exists(path):
81- return path
82- return None
83-
84- def find_db(self):
85- dbs_path = self._get_db_path()
86- if not dbs_path:
87- return None
88- files = [f for f in os.listdir(dbs_path)
89- if os.path.splitext(f)[1] == ".ini"]
90- for f in files:
91- ini_path = os.path.join(dbs_path, f)
92- with open(ini_path) as ini:
93- for line in ini:
94- if "=" in line:
95- key, val = line.strip().split("=")
96- if key == "Name" and val == "notes":
97- try:
98- return ini_path.replace(".ini", ".sqlite")
99- except OSError:
100- pass
101- return None
102
103=== modified file 'tests/autopilot/notes_app/tests/test_create.py'
104--- tests/autopilot/notes_app/tests/test_create.py 2013-09-27 14:42:07 +0000
105+++ tests/autopilot/notes_app/tests/test_create.py 2013-10-29 16:46:19 +0000
106@@ -12,12 +12,12 @@
107 from testtools.matchers import Equals
108 from autopilot.matchers import Eventually
109
110-from notes_app.tests import NotesAppTestCase, DatabaseMixin
111+from notes_app.tests import NotesAppTestCase
112
113 import os
114
115
116-class TestCreate(NotesAppTestCase, DatabaseMixin):
117+class TestCreate(NotesAppTestCase):
118 """Tests creating notes"""
119
120 """ This is needed to wait for the application to start.
121@@ -29,13 +29,7 @@
122 super(TestCreate, self).setUp()
123
124 def clean_db(self):
125- path = self.find_db()
126- if path is None:
127- self.launch_and_quit_app()
128- path = self.find_db()
129- if path is None:
130- self.assertNotEquals(path, None)
131-
132+ path = self.ensure_db()
133 try:
134 os.remove(path)
135 except OSError:
136
137=== modified file 'tests/autopilot/notes_app/tests/test_delete.py'
138--- tests/autopilot/notes_app/tests/test_delete.py 2013-10-10 09:30:43 +0000
139+++ tests/autopilot/notes_app/tests/test_delete.py 2013-10-29 16:46:19 +0000
140@@ -12,12 +12,12 @@
141 from testtools.matchers import Equals
142 from autopilot.matchers import Eventually
143
144-from notes_app.tests import NotesAppTestCase, DatabaseMixin
145+from notes_app.tests import NotesAppTestCase
146
147 import sqlite3
148
149
150-class TestDelete(NotesAppTestCase, DatabaseMixin):
151+class TestDelete(NotesAppTestCase):
152 """Tests deleting notes"""
153
154 def setUp(self):
155@@ -30,13 +30,7 @@
156 {"content":"This is a note.","type":"text"}
157 ]}"""
158
159- path = self.find_db()
160- if path is None:
161- self.launch_and_quit_app()
162- path = self.find_db()
163- if path is None:
164- self.assertNotEquals(path, None)
165-
166+ path = self.ensure_db()
167 conn = sqlite3.connect(path)
168 cursor = conn.cursor()
169 cursor.execute("DELETE FROM notes")
170
171=== modified file 'tests/autopilot/notes_app/tests/test_expand_collapse.py'
172--- tests/autopilot/notes_app/tests/test_expand_collapse.py 2013-10-01 07:42:44 +0000
173+++ tests/autopilot/notes_app/tests/test_expand_collapse.py 2013-10-29 16:46:19 +0000
174@@ -12,12 +12,12 @@
175 from testtools.matchers import Equals
176 from autopilot.matchers import Eventually
177
178-from notes_app.tests import NotesAppTestCase, DatabaseMixin
179+from notes_app.tests import NotesAppTestCase
180
181 import sqlite3
182
183
184-class TestExpandCollapse(NotesAppTestCase, DatabaseMixin):
185+class TestExpandCollapse(NotesAppTestCase):
186 """Tests deleting notes"""
187
188 def setUp(self):
189@@ -35,13 +35,7 @@
190 ]}"""
191 ]
192
193- path = self.find_db()
194- if path is None:
195- self.launch_and_quit_app()
196- path = self.find_db()
197- if path is None:
198- self.assertNotEquals(path, None)
199-
200+ path = self.ensure_db()
201 conn = sqlite3.connect(path)
202 cursor = conn.cursor()
203 cursor.execute("DELETE FROM notes")
204
205=== modified file 'tests/autopilot/notes_app/tests/test_images.py'
206--- tests/autopilot/notes_app/tests/test_images.py 2013-10-07 10:10:40 +0000
207+++ tests/autopilot/notes_app/tests/test_images.py 2013-10-29 16:46:19 +0000
208@@ -12,12 +12,12 @@
209 from testtools.matchers import Equals
210 from autopilot.matchers import Eventually
211
212-from notes_app.tests import NotesTestCaseBaseWithHTTPServer, DatabaseMixin
213+from notes_app.tests import NotesTestCaseBaseWithHTTPServer
214
215 import sqlite3
216
217
218-class BaseForTestImages(NotesTestCaseBaseWithHTTPServer, DatabaseMixin):
219+class BaseForTestImages(NotesTestCaseBaseWithHTTPServer):
220 def setUp(self):
221 self.setup_db(self.IMAGE)
222 super(BaseForTestImages, self).setUp()
223@@ -27,13 +27,7 @@
224 {"content":"http://localhost:8129/""" + image + """","type":"image"}
225 ]}"""
226
227- path = self.find_db()
228- if path is None:
229- self.launch_and_quit_app()
230- path = self.find_db()
231- if path is None:
232- self.assertNotEquals(path, None)
233-
234+ path = self.ensure_db()
235 conn = sqlite3.connect(path)
236 cursor = conn.cursor()
237 cursor.execute("DELETE FROM notes")
238
239=== modified file 'tests/autopilot/notes_app/tests/test_parts.py'
240--- tests/autopilot/notes_app/tests/test_parts.py 2013-10-07 10:21:27 +0000
241+++ tests/autopilot/notes_app/tests/test_parts.py 2013-10-29 16:46:19 +0000
242@@ -13,12 +13,12 @@
243 from autopilot.matchers import Eventually
244 from autopilot.platform import model
245
246-from notes_app.tests import NotesTestCaseBaseWithHTTPServer, DatabaseMixin
247+from notes_app.tests import NotesTestCaseBaseWithHTTPServer
248
249 import sqlite3
250
251
252-class TestFocus(NotesTestCaseBaseWithHTTPServer, DatabaseMixin):
253+class TestFocus(NotesTestCaseBaseWithHTTPServer):
254 """Tests focusing notes"""
255
256 """ This is needed to wait for the application to start.
257@@ -34,7 +34,7 @@
258 {"content":"http://localhost:8129/image.png","type":"image"}
259 ]}"""
260
261- path = self.find_db()
262+ path = self.ensure_db()
263 conn = sqlite3.connect(path)
264 cursor = conn.cursor()
265 cursor.execute("DELETE FROM notes")
266
267=== modified file 'tests/autopilot/notes_app/tests/test_quit.py'
268--- tests/autopilot/notes_app/tests/test_quit.py 2013-10-01 07:42:44 +0000
269+++ tests/autopilot/notes_app/tests/test_quit.py 2013-10-29 16:46:19 +0000
270@@ -13,7 +13,7 @@
271 from autopilot.matchers import Eventually
272 from autopilot.introspection.dbus import StateNotFoundError
273
274-from notes_app.tests import NotesAppTestCase, DatabaseMixin
275+from notes_app.tests import NotesAppTestCase
276
277 import sqlite3
278 import json
279@@ -47,17 +47,8 @@
280 return True
281 return False
282
283- def get_db_path(self):
284- path = self.find_db()
285- if path is None:
286- self.launch_and_quit_app()
287- path = self.find_db()
288- if path is None:
289- self.assertNotEquals(path, None)
290- return path
291-
292-
293-class TestQuit(NotesAppTestCase, DatabaseMixin, UtilsMixin):
294+
295+class TestQuit(NotesAppTestCase, UtilsMixin):
296 """Tests save on quit"""
297
298 """ This is needed to wait for the application to start.
299@@ -72,7 +63,7 @@
300 {"content":"foobar","type":"text"}
301 ]}"""
302
303- path = self.get_db_path()
304+ path = self.ensure_db()
305 conn = sqlite3.connect(path)
306 cursor = conn.cursor()
307 cursor.execute("DELETE FROM notes")
308@@ -92,7 +83,7 @@
309
310 self.assertThat(self.app_has_quit, Eventually(Equals(True)))
311
312- path = self.find_db()
313+ path = self.ensure_db()
314 conn = sqlite3.connect(path)
315 cursor = conn.cursor()
316
317@@ -105,7 +96,7 @@
318 self.assertEquals(data["elements"][0]["content"], "foobarxxx")
319
320
321-class TestQuitNoNote(NotesAppTestCase, DatabaseMixin, UtilsMixin):
322+class TestQuitNoNote(NotesAppTestCase, UtilsMixin):
323 """Tests save on quit with no notes"""
324
325 """ This is needed to wait for the application to start.
326@@ -116,7 +107,7 @@
327 super(TestQuitNoNote, self).setUp()
328
329 def setup_db(self):
330- path = self.get_db_path()
331+ path = self.ensure_db()
332 conn = sqlite3.connect(path)
333 cursor = conn.cursor()
334 cursor.execute("DELETE FROM notes")
335@@ -134,7 +125,7 @@
336
337 self.assertThat(self.app_has_quit, Eventually(Equals(True)))
338
339- path = self.find_db()
340+ path = self.ensure_db()
341 conn = sqlite3.connect(path)
342 cursor = conn.cursor()
343

Subscribers

People subscribed via source and target branches