Merge lp:~alextu/savilerow/6-pinned-apps into lp:savilerow

Proposed by Alex Tu
Status: Merged
Merged at revision: 12
Proposed branch: lp:~alextu/savilerow/6-pinned-apps
Merge into: lp:savilerow
Diff against target: 40 lines (+18/-0)
2 files modified
src/system/custom/etc/dconf_source/db/custom.d/custom.key (+5/-0)
tests/api/test_dconf.py (+13/-0)
To merge this branch: bzr merge lp:~alextu/savilerow/6-pinned-apps
Reviewer Review Type Date Requested Status
Chris Wayne (community) Approve
Alex Tu (community) Approve
Review via email: mp+228455@code.launchpad.net

Description of the change

1. add the key com/canonical/unity/clickscope/core-apps as an example to set 6 pinned apps on Apps scop.
2. add a test script for check if the setting of 6 pinned apps in Apps scope is correct.
  Currently it tests
  1. If the key and value has been set in custom.key, and it must been set.
  2. If the value have 6 items, it must have 6 items.

To post a comment you must log in.
Revision history for this message
Chris Wayne (cwayne) wrote :

Why is there a whole new test script added? It looks very similar to the current test_dconf test, which should in fact pick up this change anyway without needing to add any tests

review: Needs Fixing
lp:~alextu/savilerow/6-pinned-apps updated
15. By Alex Tu

merged the operation for pinned apps setting to test_dconf.py.

Revision history for this message
Alex Tu (alextu) wrote :

> Why is there a whole new test script added? It looks very similar to the
> current test_dconf test, which should in fact pick up this change anyway
> without needing to add any tests

I have merged the operations for pinned apps setting to test_dconf.py.
And verified on Nexus 4.
It will assert in two case:
  1. If the key(com.canonical.unity.clickscope.core-apps) and value has been set in custom.key,it must been set.
  2. If the value have 6 items(split by ','),it must have 6 items.

review: Needs Resubmitting
lp:~alextu/savilerow/6-pinned-apps updated
16. By Alex Tu

removed comment code.

Revision history for this message
Alex Tu (alextu) :
review: Approve
Revision history for this message
Chris Wayne (cwayne) wrote :

One thing we may want to investigate is whether or not we can use the short app-id instead of the full one, so that it won't blow up when a different version of the app is shipped.

Revision history for this message
Chris Wayne (cwayne) wrote :

So I just pinged pstolowski (who implemented this) and he said:

(04:36:30 PM) pstolowski: cwayne, no version numbers

So we should just have 'com.ubuntu.gallery_gallery', 'com.ubuntu.music_music' and so on. This is also much more future-proof (sorry, I know I was the one that first told you to include the version numbers, but I was wrong :) )

review: Needs Fixing
Revision history for this message
Alex Tu (alextu) wrote :

It's ok, I'll modify it soon. :)

lp:~alextu/savilerow/6-pinned-apps updated
17. By Alex Tu

remove the version for pinned apps, it doesn't need version information.

Revision history for this message
Alex Tu (alextu) wrote :

Already removed the version string and verified on image version 157 of devel-proposed channel on Nexus 4, and it passed.

Thanks.

Revision history for this message
Chris Wayne (cwayne) wrote :

LGTM, thanks for retesting

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/system/custom/etc/dconf_source/db/custom.d/custom.key'
2--- src/system/custom/etc/dconf_source/db/custom.d/custom.key 2014-05-07 22:36:50 +0000
3+++ src/system/custom/etc/dconf_source/db/custom.d/custom.key 2014-08-06 10:14:38 +0000
4@@ -12,3 +12,8 @@
5 [com/canonical/UserMetrics]
6 theme='custom'
7
8+# This used for set the 6 pinned apps in Apps scop.
9+# The installed apps could refer to /home/phablet/.cache/ubuntu-app-launch/desktop on device.
10+[com/canonical/unity/clickscope]
11+core-apps=['com.ubuntu.gallery_gallery', 'com.ubuntu.music_music', 'com.ubuntu.calculator_calculator', 'com.ubuntu.clock_clock', 'com.ubuntu.weather_weather', 'com.ubuntu.camera_camera']
12+
13
14=== modified file 'tests/api/test_dconf.py'
15--- tests/api/test_dconf.py 2014-04-15 16:30:38 +0000
16+++ tests/api/test_dconf.py 2014-08-06 10:14:38 +0000
17@@ -6,6 +6,9 @@
18 #: Path to pre-seeded custom dconf database
19 custom_dconf_key = '/custom/etc/dconf/db/custom.d/custom.key'
20
21+# For 6-pinned apps: key we would like to verify and The apps number we should set.
22+pinned_apps_key = '/com/canonical/unity/clickscope/core-apps'
23+expect_pinned_apps_num = 6
24
25 class DconfVerificationTests(AutopilotTestCase):
26
27@@ -41,3 +44,13 @@
28 # `dconf read`
29 dval = subprocess.check_output(['dconf', 'read', key]).decode().strip()
30 self.assertEqual(dval, value)
31+
32+ # For 6-pinned apps: check if the apps has been set in custom.key.
33+ pinned_apps = dconf_keys.get(pinned_apps_key,0)
34+ if (pinned_apps == 0) or (pinned_apps == ''):
35+ print("core-apps value not preset in %s" %(custom_dconf_key))
36+ self.assertTrue(0);
37+ # check if there have 6 item in value.
38+ word_list=pinned_apps.split(',');
39+ self.assertTrue(len(word_list) == expect_pinned_apps_num, "incorrect number of pinned apps been set!");
40+

Subscribers

People subscribed via source and target branches

to all changes: