Merge lp:~elopio/reminders-app/evernote-sdk into lp:reminders-app
- evernote-sdk
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Nicholas Skaggs |
Approved revision: | 143 |
Merged at revision: | 152 |
Proposed branch: | lp:~elopio/reminders-app/evernote-sdk |
Merge into: | lp:reminders-app |
Prerequisite: | lp:~elopio/reminders-app/autopilot-add_notebook |
Diff against target: |
375 lines (+288/-12) 5 files modified
debian/control (+2/-0) tests/autopilot/reminders/__init__.py (+2/-5) tests/autopilot/reminders/evernote.py (+132/-0) tests/autopilot/reminders/tests/test_evernote.py (+128/-0) tests/autopilot/reminders/tests/test_reminders.py (+24/-7) |
To merge this branch: | bzr merge lp:~elopio/reminders-app/evernote-sdk |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Carla Sella | Pending | ||
Richard Huddie | Pending | ||
Julia Palandri | Pending | ||
VĂctor R. Ruiz | Pending | ||
Allan LeSage | Pending | ||
Ubuntu Notes app developers | Pending | ||
Review via email:
|
Commit message
Added helpers for setting up and cleaning up the evernote account.
Added a test to check that an added note will be created on the server.
Make sure that all tests remove all the things they create.
Description of the change
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:142
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:143
http://
Executed test runs:
None: http://
None: http://
None: http://
None: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:142
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:143
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
UNSTABLE: http://
deb: http://
UNSTABLE: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) : | # |
Preview Diff
1 | === modified file 'debian/control' | |||
2 | --- debian/control 2014-05-16 12:52:13 +0000 | |||
3 | +++ debian/control 2014-05-22 08:31:45 +0000 | |||
4 | @@ -50,12 +50,14 @@ | |||
5 | 50 | Package: reminders-app-autopilot | 50 | Package: reminders-app-autopilot |
6 | 51 | Architecture: all | 51 | Architecture: all |
7 | 52 | Depends: ${misc:Depends}, | 52 | Depends: ${misc:Depends}, |
8 | 53 | evernote-sdk-python3, | ||
9 | 53 | reminders-app (>= ${source:Version}), reminders-app (<< ${source:Version}.1~), | 54 | reminders-app (>= ${source:Version}), reminders-app (<< ${source:Version}.1~), |
10 | 54 | libautopilot-qt, | 55 | libautopilot-qt, |
11 | 55 | libqt5test5, | 56 | libqt5test5, |
12 | 56 | python3-dbus, | 57 | python3-dbus, |
13 | 57 | python3-dbusmock, | 58 | python3-dbusmock, |
14 | 58 | python3-fixtures, | 59 | python3-fixtures, |
15 | 60 | python3-thrift, | ||
16 | 59 | ubuntu-ui-toolkit-autopilot, | 61 | ubuntu-ui-toolkit-autopilot, |
17 | 60 | Description: Test package for the Reminders app | 62 | Description: Test package for the Reminders app |
18 | 61 | Autopilot tests for the Reminders app package | 63 | Autopilot tests for the Reminders app package |
19 | 62 | 64 | ||
20 | === modified file 'tests/autopilot/reminders/__init__.py' | |||
21 | --- tests/autopilot/reminders/__init__.py 2014-05-22 08:31:45 +0000 | |||
22 | +++ tests/autopilot/reminders/__init__.py 2014-05-22 08:31:45 +0000 | |||
23 | @@ -21,12 +21,9 @@ | |||
24 | 21 | import logging | 21 | import logging |
25 | 22 | from distutils import version | 22 | from distutils import version |
26 | 23 | 23 | ||
28 | 24 | <<<<<<< TREE | 24 | import ubuntuuitoolkit |
29 | 25 | |||
30 | 25 | import autopilot | 26 | import autopilot |
31 | 26 | ======= | ||
32 | 27 | import ubuntuuitoolkit | ||
33 | 28 | |||
34 | 29 | >>>>>>> MERGE-SOURCE | ||
35 | 30 | from autopilot import logging as autopilot_logging | 27 | from autopilot import logging as autopilot_logging |
36 | 31 | from autopilot.introspection import dbus | 28 | from autopilot.introspection import dbus |
37 | 32 | from ubuntuuitoolkit import emulators as toolkit_emulators | 29 | from ubuntuuitoolkit import emulators as toolkit_emulators |
38 | 33 | 30 | ||
39 | === added file 'tests/autopilot/reminders/evernote.py' | |||
40 | --- tests/autopilot/reminders/evernote.py 1970-01-01 00:00:00 +0000 | |||
41 | +++ tests/autopilot/reminders/evernote.py 2014-05-22 08:31:45 +0000 | |||
42 | @@ -0,0 +1,132 @@ | |||
43 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
44 | 2 | # | ||
45 | 3 | # Copyright (C) 2014 Canonical Ltd. | ||
46 | 4 | # | ||
47 | 5 | # This program is free software; you can redistribute it and/or modify | ||
48 | 6 | # it under the terms of the GNU General Public License version 3, as published | ||
49 | 7 | # by the Free Software Foundation. | ||
50 | 8 | # | ||
51 | 9 | # This program is distributed in the hope that it will be useful, | ||
52 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
53 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
54 | 12 | # GNU General Public License for more details. | ||
55 | 13 | # | ||
56 | 14 | # You should have received a copy of the GNU General Public License | ||
57 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
58 | 16 | |||
59 | 17 | |||
60 | 18 | from evernote.api import client | ||
61 | 19 | from evernote.edam.type import ttypes | ||
62 | 20 | from evernote.edam.error import ttypes as errors | ||
63 | 21 | |||
64 | 22 | |||
65 | 23 | TEST_OAUTH_TOKEN = ( | ||
66 | 24 | 'S=s1:U=8e6bf:E=14d08e375ff:C=145b1324a03:P=1cd:A=en-devtoken:V=2:' | ||
67 | 25 | 'H=79b946c32b4515ee52b387f7b68baa69') | ||
68 | 26 | EVERNOTE_NOTE_XML_PROLOG = ( | ||
69 | 27 | '<?xml version="1.0" encoding="UTF-8"?>' | ||
70 | 28 | '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">') | ||
71 | 29 | EVERNOTE_NOTE_XML_ELEMENT_FORMAT = '<en-note>{}</en-note>' | ||
72 | 30 | |||
73 | 31 | |||
74 | 32 | class SandboxEvernoteClient(client.EvernoteClient): | ||
75 | 33 | """Client to access the Evernote API on the sandbox server.""" | ||
76 | 34 | |||
77 | 35 | def __init__(self): | ||
78 | 36 | super(SandboxEvernoteClient, self).__init__( | ||
79 | 37 | token=TEST_OAUTH_TOKEN, sandbox=True) | ||
80 | 38 | |||
81 | 39 | @property | ||
82 | 40 | def note_store(self): | ||
83 | 41 | return self.get_note_store() | ||
84 | 42 | |||
85 | 43 | def create_notebook(self, name): | ||
86 | 44 | """Create a notebook. | ||
87 | 45 | |||
88 | 46 | :param name: The name of the notebook to create. | ||
89 | 47 | :return: The created notebook. | ||
90 | 48 | |||
91 | 49 | """ | ||
92 | 50 | notebook = ttypes.Notebook() | ||
93 | 51 | notebook.name = name | ||
94 | 52 | |||
95 | 53 | return self.note_store.createNotebook(notebook) | ||
96 | 54 | |||
97 | 55 | def create_note(self, title, content, notebook_guid): | ||
98 | 56 | """Create a note. | ||
99 | 57 | |||
100 | 58 | :param title: The title of the note to create. | ||
101 | 59 | :param content: The content to add to the note. | ||
102 | 60 | :return: The created note. | ||
103 | 61 | |||
104 | 62 | """ | ||
105 | 63 | note = ttypes.Note() | ||
106 | 64 | note.title = title | ||
107 | 65 | note.content = EVERNOTE_NOTE_XML_PROLOG | ||
108 | 66 | note.content += EVERNOTE_NOTE_XML_ELEMENT_FORMAT.format(content) | ||
109 | 67 | note.notebookGuid = notebook_guid | ||
110 | 68 | |||
111 | 69 | return self.note_store.createNote(note) | ||
112 | 70 | |||
113 | 71 | def get_note_content(self, note_guid): | ||
114 | 72 | """Return the content of a note. | ||
115 | 73 | |||
116 | 74 | :param note_guid: The GUID of the note. | ||
117 | 75 | :return: The content of the note. | ||
118 | 76 | |||
119 | 77 | """ | ||
120 | 78 | return self.note_store.getNoteContent(note_guid) | ||
121 | 79 | |||
122 | 80 | def expunge_notebook(self, notebook_guid): | ||
123 | 81 | """Permanently remove a notebook. | ||
124 | 82 | |||
125 | 83 | :param notebook_guid: The GUID of the notebook to expunge. | ||
126 | 84 | |||
127 | 85 | """ | ||
128 | 86 | self.note_store.expungeNotebook(notebook_guid) | ||
129 | 87 | |||
130 | 88 | def get_notebook(self, notebook_guid): | ||
131 | 89 | """Return a notebook. | ||
132 | 90 | |||
133 | 91 | :param notebook_guid: The GUID of the notebook. | ||
134 | 92 | |||
135 | 93 | """ | ||
136 | 94 | return self.note_store.getNotebook(notebook_guid) | ||
137 | 95 | |||
138 | 96 | def expunge_note(self, note_guid): | ||
139 | 97 | """Permanently remove a note. | ||
140 | 98 | |||
141 | 99 | :param note_guid: The GUID of the note to expunge. | ||
142 | 100 | |||
143 | 101 | """ | ||
144 | 102 | return self.note_store.expungeNote(note_guid) | ||
145 | 103 | |||
146 | 104 | def get_note(self, note_guid): | ||
147 | 105 | """Return a note. | ||
148 | 106 | |||
149 | 107 | :param note_guid: The GUID of the note. | ||
150 | 108 | |||
151 | 109 | """ | ||
152 | 110 | return self.note_store.getNote(note_guid, False, False, False, False) | ||
153 | 111 | |||
154 | 112 | def expunge_notebook_by_name(self, name): | ||
155 | 113 | """Permanently remove a notebook. | ||
156 | 114 | |||
157 | 115 | :param name: The first notebook found with this name will be expunged. | ||
158 | 116 | |||
159 | 117 | """ | ||
160 | 118 | notebook = self.get_notebook_by_name(name) | ||
161 | 119 | self.expunge_notebook(notebook.guid) | ||
162 | 120 | |||
163 | 121 | def get_notebook_by_name(self, name): | ||
164 | 122 | """Return a notebook. | ||
165 | 123 | |||
166 | 124 | :param name: The first notebook found with this name will be returned. | ||
167 | 125 | |||
168 | 126 | """ | ||
169 | 127 | notebooks = self.note_store.listNotebooks() | ||
170 | 128 | for notebook in notebooks: | ||
171 | 129 | if notebook.name == name: | ||
172 | 130 | return notebook | ||
173 | 131 | else: | ||
174 | 132 | raise errors.EDAMNotFoundException() | ||
175 | 0 | 133 | ||
176 | === added file 'tests/autopilot/reminders/tests/test_evernote.py' | |||
177 | --- tests/autopilot/reminders/tests/test_evernote.py 1970-01-01 00:00:00 +0000 | |||
178 | +++ tests/autopilot/reminders/tests/test_evernote.py 2014-05-22 08:31:45 +0000 | |||
179 | @@ -0,0 +1,128 @@ | |||
180 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
181 | 2 | # | ||
182 | 3 | # Copyright (C) 2014 Canonical Ltd. | ||
183 | 4 | # | ||
184 | 5 | # This program is free software; you can redistribute it and/or modify | ||
185 | 6 | # it under the terms of the GNU General Public License version 3, as published | ||
186 | 7 | # by the Free Software Foundation. | ||
187 | 8 | # | ||
188 | 9 | # This program is distributed in the hope that it will be useful, | ||
189 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
190 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
191 | 12 | # GNU General Public License for more details. | ||
192 | 13 | # | ||
193 | 14 | # You should have received a copy of the GNU General Public License | ||
194 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
195 | 16 | |||
196 | 17 | import uuid | ||
197 | 18 | |||
198 | 19 | import testtools | ||
199 | 20 | from evernote.edam.error import ttypes as errors | ||
200 | 21 | |||
201 | 22 | |||
202 | 23 | from reminders import evernote | ||
203 | 24 | |||
204 | 25 | |||
205 | 26 | class EvernoteTestCase(testtools.TestCase): | ||
206 | 27 | """Test the evernote access with the SDK.""" | ||
207 | 28 | |||
208 | 29 | def setUp(self): | ||
209 | 30 | super(EvernoteTestCase, self).setUp() | ||
210 | 31 | self.client = evernote.SandboxEvernoteClient() | ||
211 | 32 | |||
212 | 33 | def create_test_notebook(self, name=None): | ||
213 | 34 | if name is None: | ||
214 | 35 | name = 'Test notebook {}'.format(uuid.uuid1()) | ||
215 | 36 | created_notebook = self.client.create_notebook(name) | ||
216 | 37 | self.addCleanup(self.expunge_test_notebook, created_notebook.guid) | ||
217 | 38 | return created_notebook | ||
218 | 39 | |||
219 | 40 | def expunge_test_notebook(self, notebook_guid): | ||
220 | 41 | try: | ||
221 | 42 | self.client.expunge_notebook(notebook_guid) | ||
222 | 43 | except errors.EDAMNotFoundException: | ||
223 | 44 | # The notebook was already deleted or not successfully created. | ||
224 | 45 | pass | ||
225 | 46 | |||
226 | 47 | def create_test_note(self, title=None, content=None, notebook_guid=None): | ||
227 | 48 | if title is None: | ||
228 | 49 | title = 'Test note {}'.format(uuid.uuid1()) | ||
229 | 50 | if content is None: | ||
230 | 51 | content = 'test content.' | ||
231 | 52 | if notebook_guid is None: | ||
232 | 53 | notebook = self.create_test_notebook() | ||
233 | 54 | notebook_guid = notebook.guid | ||
234 | 55 | |||
235 | 56 | created_note = self.client.create_note(title, content, notebook_guid) | ||
236 | 57 | self.addCleanup(self.expunge_test_note, created_note.guid) | ||
237 | 58 | return created_note | ||
238 | 59 | |||
239 | 60 | def expunge_test_note(self, note_guid): | ||
240 | 61 | try: | ||
241 | 62 | self.client.expunge_note(note_guid) | ||
242 | 63 | except errors.EDAMNotFoundException: | ||
243 | 64 | # The note was already deleted or not successfully created. | ||
244 | 65 | pass | ||
245 | 66 | |||
246 | 67 | def test_create_notebook(self): | ||
247 | 68 | """Test that we can create a notebook on the evernote server.""" | ||
248 | 69 | test_notebook_name = 'Test notebook {}'.format(uuid.uuid1()) | ||
249 | 70 | |||
250 | 71 | # An exception will be raised if the notebook can't be created. | ||
251 | 72 | created_notebook = self.create_test_notebook(test_notebook_name) | ||
252 | 73 | |||
253 | 74 | self.assertEqual(created_notebook.name, test_notebook_name) | ||
254 | 75 | |||
255 | 76 | def test_create_note(self): | ||
256 | 77 | """Test that we can create a note on the evernote server.""" | ||
257 | 78 | test_note_title = 'Test note {}'.format(uuid.uuid1()) | ||
258 | 79 | test_note_content = 'test content.' | ||
259 | 80 | test_notebook = self.create_test_notebook() | ||
260 | 81 | |||
261 | 82 | # An exception will be raised if the note can't be created. | ||
262 | 83 | created_note = self.create_test_note( | ||
263 | 84 | test_note_title, test_note_content, test_notebook.guid) | ||
264 | 85 | |||
265 | 86 | self.assertEqual(created_note.title, test_note_title) | ||
266 | 87 | created_note_content = self.client.get_note_content( | ||
267 | 88 | created_note.guid) | ||
268 | 89 | self.assertIn(test_note_content, created_note_content) | ||
269 | 90 | |||
270 | 91 | def test_expunge_notebook_must_permanently_remove_it(self): | ||
271 | 92 | """Test that an expunged notebook is no longer available.""" | ||
272 | 93 | created_notebook = self.create_test_notebook() | ||
273 | 94 | |||
274 | 95 | self.client.expunge_notebook(created_notebook.guid) | ||
275 | 96 | |||
276 | 97 | self.assertRaises( | ||
277 | 98 | errors.EDAMNotFoundException, | ||
278 | 99 | self.client.get_notebook, | ||
279 | 100 | created_notebook.guid) | ||
280 | 101 | |||
281 | 102 | def test_expunge_note_must_permanently_remove_it(self): | ||
282 | 103 | """Test that an expunged note is no longer available.""" | ||
283 | 104 | created_note = self.create_test_note() | ||
284 | 105 | |||
285 | 106 | self.client.expunge_note(created_note.guid) | ||
286 | 107 | |||
287 | 108 | self.assertRaises( | ||
288 | 109 | errors.EDAMNotFoundException, | ||
289 | 110 | self.client.get_note, | ||
290 | 111 | created_note.guid) | ||
291 | 112 | |||
292 | 113 | def test_expunge_notebook_by_name_must_permanently_remove_it(self): | ||
293 | 114 | """Test that an expunged notebook is no longer available.""" | ||
294 | 115 | created_notebook = self.create_test_notebook() | ||
295 | 116 | |||
296 | 117 | self.client.expunge_notebook_by_name(created_notebook.name) | ||
297 | 118 | |||
298 | 119 | self.assertRaises( | ||
299 | 120 | errors.EDAMNotFoundException, | ||
300 | 121 | self.client.get_notebook, | ||
301 | 122 | created_notebook.guid) | ||
302 | 123 | |||
303 | 124 | def test_get_unexisting_notebook_by_name_must_raise_exception(self): | ||
304 | 125 | self.assertRaises( | ||
305 | 126 | errors.EDAMNotFoundException, | ||
306 | 127 | self.client.get_notebook_by_name, | ||
307 | 128 | 'I do not exist.') | ||
308 | 0 | 129 | ||
309 | === modified file 'tests/autopilot/reminders/tests/test_reminders.py' | |||
310 | --- tests/autopilot/reminders/tests/test_reminders.py 2014-05-22 08:31:45 +0000 | |||
311 | +++ tests/autopilot/reminders/tests/test_reminders.py 2014-05-22 08:31:45 +0000 | |||
312 | @@ -23,10 +23,11 @@ | |||
313 | 23 | 23 | ||
314 | 24 | from autopilot import platform | 24 | from autopilot import platform |
315 | 25 | from autopilot.matchers import Eventually | 25 | from autopilot.matchers import Eventually |
316 | 26 | from evernote.edam.error import ttypes as evernote_errors | ||
317 | 26 | from testtools.matchers import Equals | 27 | from testtools.matchers import Equals |
318 | 27 | 28 | ||
319 | 28 | import reminders | 29 | import reminders |
321 | 29 | from reminders import credentials, fixture_setup, tests | 30 | from reminders import credentials, evernote, fixture_setup, tests |
322 | 30 | 31 | ||
323 | 31 | 32 | ||
324 | 32 | logger = logging.getLogger(__name__) | 33 | logger = logging.getLogger(__name__) |
325 | @@ -66,24 +67,29 @@ | |||
326 | 66 | no_account_dialog = self.app.main_view.no_account_dialog | 67 | no_account_dialog = self.app.main_view.no_account_dialog |
327 | 67 | self.add_evernote_account() | 68 | self.add_evernote_account() |
328 | 68 | no_account_dialog.wait_until_destroyed() | 69 | no_account_dialog.wait_until_destroyed() |
329 | 70 | self.evernote_client = evernote.SandboxEvernoteClient() | ||
330 | 69 | 71 | ||
331 | 70 | def add_evernote_account(self): | 72 | def add_evernote_account(self): |
332 | 71 | account_manager = credentials.AccountManager() | 73 | account_manager = credentials.AccountManager() |
333 | 72 | oauth_token = ( | ||
334 | 73 | 'S=s1:U=8e6bf:E=14d08e375ff:C=145b1324a03:P=1cd:A=en-devtoken:' | ||
335 | 74 | 'V=2:H=79b946c32b4515ee52b387f7b68baa69') | ||
336 | 75 | account = account_manager.add_evernote_account( | 74 | account = account_manager.add_evernote_account( |
338 | 76 | 'dummy', 'dummy', oauth_token) | 75 | 'dummy', 'dummy', evernote.TEST_OAUTH_TOKEN) |
339 | 77 | self.addCleanup(account_manager.delete_account, account) | 76 | self.addCleanup(account_manager.delete_account, account) |
340 | 78 | del account_manager._manager | 77 | del account_manager._manager |
341 | 79 | del account_manager | 78 | del account_manager |
342 | 80 | 79 | ||
343 | 80 | def expunge_test_notebook(self, notebook_name): | ||
344 | 81 | try: | ||
345 | 82 | self.evernote_client.expunge_notebook_by_name(notebook_name) | ||
346 | 83 | except evernote_errors.EDAMNotFoundException: | ||
347 | 84 | # The notebook was already deleted or not successfully created. | ||
348 | 85 | pass | ||
349 | 86 | |||
350 | 81 | def test_add_notebook_must_append_it_to_list(self): | 87 | def test_add_notebook_must_append_it_to_list(self): |
351 | 88 | """Test that an added notebook will be available for selection.""" | ||
352 | 82 | test_notebook_title = 'Test notebook {}'.format(uuid.uuid1()) | 89 | test_notebook_title = 'Test notebook {}'.format(uuid.uuid1()) |
353 | 90 | self.addCleanup(self.expunge_test_notebook, test_notebook_title) | ||
354 | 83 | 91 | ||
355 | 84 | notebooks_page = self.app.open_notebooks() | 92 | notebooks_page = self.app.open_notebooks() |
356 | 85 | # FIXME delete the added notebook. Otherwise, the test account will | ||
357 | 86 | # fill up. See http://pad.lv/1318749 --elopio - 2014-05-12 | ||
358 | 87 | notebooks_page.add_notebook(test_notebook_title) | 93 | notebooks_page.add_notebook(test_notebook_title) |
359 | 88 | 94 | ||
360 | 89 | last_notebook = notebooks_page.get_notebooks()[-1] | 95 | last_notebook = notebooks_page.get_notebooks()[-1] |
361 | @@ -96,3 +102,14 @@ | |||
362 | 96 | self.assertEqual(last_notebook[0], test_notebook_title) | 102 | self.assertEqual(last_notebook[0], test_notebook_title) |
363 | 97 | self.assertEqual(last_notebook[2], 'Private') | 103 | self.assertEqual(last_notebook[2], 'Private') |
364 | 98 | self.assertEqual(last_notebook[3], 0) | 104 | self.assertEqual(last_notebook[3], 0) |
365 | 105 | |||
366 | 106 | def test_add_notebook_must_create_it_in_server(self): | ||
367 | 107 | """Test that an added notebook will be created on the server.""" | ||
368 | 108 | test_notebook_title = 'Test notebook {}'.format(uuid.uuid1()) | ||
369 | 109 | self.addCleanup(self.expunge_test_notebook, test_notebook_title) | ||
370 | 110 | |||
371 | 111 | notebooks_page = self.app.open_notebooks() | ||
372 | 112 | notebooks_page.add_notebook(test_notebook_title) | ||
373 | 113 | |||
374 | 114 | # An exception will be raised if the notebook is note found. | ||
375 | 115 | self.evernote_client.get_notebook_by_name(test_notebook_title) |
FAILED: Continuous integration, rev:142 91.189. 93.70:8080/ job/reminders- app-ci/ 355/ 91.189. 93.70:8080/ job/generic- mediumtests- trusty/ 2643/console 91.189. 93.70:8080/ job/generic- mediumtests- trusty/ 2643/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 180/console 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 180/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/reminders- app-trusty- amd64-ci/ 356 91.189. 93.70:8080/ job/reminders- app-utopic- amd64-ci/ 50
http://
Executed test runs:
FAILURE: http://
deb: http://
FAILURE: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/reminders- app-ci/ 355/rebuild
http://