Merge lp:~nskaggs/reminders-app/finish-go-to-accounts into lp:reminders-app

Proposed by Nicholas Skaggs
Status: Rejected
Rejected by: Nicholas Skaggs
Proposed branch: lp:~nskaggs/reminders-app/finish-go-to-accounts
Merge into: lp:reminders-app
Diff against target: 170 lines (+131/-2)
4 files modified
debian/control (+3/-0)
tests/autopilot/reminders/fake_services.py (+66/-0)
tests/autopilot/reminders/fixture_setup.py (+34/-0)
tests/autopilot/reminders/tests/test_reminders.py (+28/-2)
To merge this branch: bzr merge lp:~nskaggs/reminders-app/finish-go-to-accounts
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Ubuntu Notes app developers Pending
Review via email: mp+217946@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Trying to see if jenkins will still complain after rebasing to trunk.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
107. By Nicholas Skaggs

try switching to reminders_app

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
108. By Nicholas Skaggs

switch to reminders_app and try jenkins

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
109. By Nicholas Skaggs

revert back to reminders

110. By Nicholas Skaggs

revert python3 depends

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)

Unmerged revisions

110. By Nicholas Skaggs

revert python3 depends

109. By Nicholas Skaggs

revert back to reminders

108. By Nicholas Skaggs

switch to reminders_app and try jenkins

107. By Nicholas Skaggs

try switching to reminders_app

106. By Nicholas Skaggs

rebase to trunk

105. By Nicholas Skaggs

elopio's test account2

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2014-04-04 06:15:42 +0000
+++ debian/control 2014-05-01 18:07:26 +0000
@@ -51,6 +51,9 @@
51 reminders-app (= ${source:Version}),51 reminders-app (= ${source:Version}),
52 libautopilot-qt,52 libautopilot-qt,
53 libqt5test5,53 libqt5test5,
54 python-dbus,
55 python-dbusmock,
56 python-fixtures,
54 ubuntu-ui-toolkit-autopilot,57 ubuntu-ui-toolkit-autopilot,
55Description: Test package for the Reminders app58Description: Test package for the Reminders app
56 Autopilot tests for the Reminders app package59 Autopilot tests for the Reminders app package
5760
=== added file 'tests/autopilot/reminders/fake_services.py'
--- tests/autopilot/reminders/fake_services.py 1970-01-01 00:00:00 +0000
+++ tests/autopilot/reminders/fake_services.py 2014-05-01 18:07:26 +0000
@@ -0,0 +1,66 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#
3# Copyright (C) 2014 Canonical Ltd.
4#
5# This file is part of reminders
6#
7# reminders is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; version 3.
10#
11# reminders is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19import subprocess
20
21import dbus
22import dbusmock
23
24import reminders
25
26
27class FakeURLDispatcherService(object):
28 """Fake URL Dispatcher service using a dbusmock interface."""
29
30 def __init__(self):
31 super(FakeURLDispatcherService, self).__init__()
32 self.dbus_connection = dbusmock.DBusTestCase.get_dbus(system_bus=False)
33
34 def start(self):
35 """Start the fake URL Dispatcher service."""
36 # Stop the real url-dispatcher.
37 subprocess.call(['initctl', 'stop', 'url-dispatcher'])
38 self.dbus_mock_server = dbusmock.DBusTestCase.spawn_server(
39 'com.canonical.URLDispatcher',
40 '/com/canonical/URLDispatcher',
41 'com.canonical.URLDispatcher',
42 system_bus=False,
43 stdout=subprocess.PIPE)
44 self.mock = self._get_mock_interface()
45 self.mock.AddMethod(
46 'com.canonical.URLDispatcher', 'DispatchURL', 's', '', '')
47
48 def _get_mock_interface(self):
49 return dbus.Interface(
50 self.dbus_connection.get_object(
51 'com.canonical.URLDispatcher', '/com/canonical/URLDispatcher'),
52 dbusmock.MOCK_IFACE)
53
54 def stop(self):
55 """Stop the fake URL Dispatcher service."""
56 self.dbus_mock_server.terminate()
57 self.dbus_mock_server.wait()
58
59 def get_last_dispatch_url_call_parameter(self):
60 """Return the parameter used in the last call to dispatch URL."""
61 calls = self.mock.GetCalls()
62 if len(calls) == 0:
63 raise reminders.RemindersAppException(
64 'URL dispatcher has not been called.')
65 last_call = self.mock.GetCalls()[-1]
66 return last_call[2][0]
067
=== added file 'tests/autopilot/reminders/fixture_setup.py'
--- tests/autopilot/reminders/fixture_setup.py 1970-01-01 00:00:00 +0000
+++ tests/autopilot/reminders/fixture_setup.py 2014-05-01 18:07:26 +0000
@@ -0,0 +1,34 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#
3# Copyright (C) 2014 Canonical Ltd.
4#
5# This file is part of reminders
6#
7# reminders is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; version 3.
10#
11# reminders is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19
20import fixtures
21
22from reminders import fake_services
23
24
25class FakeURLDispatcher(fixtures.Fixture):
26
27 def setUp(self):
28 super(FakeURLDispatcher, self).setUp()
29 self.fake_service = fake_services.FakeURLDispatcherService()
30 self.addCleanup(self.fake_service.stop)
31 self.fake_service.start()
32
33 def get_last_dispatch_url_call_parameter(self):
34 return self.fake_service.get_last_dispatch_url_call_parameter()
035
=== modified file 'tests/autopilot/reminders/tests/test_reminders.py'
--- tests/autopilot/reminders/tests/test_reminders.py 2014-04-04 06:14:54 +0000
+++ tests/autopilot/reminders/tests/test_reminders.py 2014-05-01 18:07:26 +0000
@@ -18,10 +18,16 @@
1818
19from __future__ import absolute_import19from __future__ import absolute_import
2020
21from reminders import tests
22
23import logging21import logging
2422
23from autopilot import platform
24from autopilot.matchers import Eventually
25from testtools.matchers import Equals
26
27import reminders
28from reminders import fixture_setup, tests
29
30
25logger = logging.getLogger(__name__)31logger = logging.getLogger(__name__)
2632
2733
@@ -30,3 +36,23 @@
30 def test_open_application_without_account(self):36 def test_open_application_without_account(self):
31 """Test that the No account dialog is visible."""37 """Test that the No account dialog is visible."""
32 self.assertTrue(self.app.main_view.no_account_dialog.visible)38 self.assertTrue(self.app.main_view.no_account_dialog.visible)
39
40 def test_go_to_account_settings(self):
41 """Test that the Go to account settings button calls url-dispatcher."""
42 if platform.model() == 'Desktop':
43 self.skipTest("URL dispatcher doesn't work on the desktop.")
44 url_dispatcher = fixture_setup.FakeURLDispatcher()
45 self.useFixture(url_dispatcher)
46
47 self.app.main_view.no_account_dialog.open_account_settings()
48
49 def get_last_dispatch_url_call_parameter():
50 # Workaround for http://pad.lv/1312384
51 try:
52 return url_dispatcher.get_last_dispatch_url_call_parameter()
53 except reminders.RemindersAppException:
54 return None
55
56 self.assertThat(
57 get_last_dispatch_url_call_parameter,
58 Eventually(Equals('settings:///system/online-accounts')))

Subscribers

People subscribed via source and target branches