2
# Copyright (C) 2013 Canonical Ltd.
3
# Author: Sergio Schvezov <sergio.schvezov@canonical.com>
5
# This program is free software: you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; version 3 of the License.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program. If not, see <http://www.gnu.org/licenses/>.
23
'http://people.canonical.com/~ubuntu-archive/click_packages/click_list'
26
def get_install_list():
27
request = urllib.request.urlopen(click_list_url).read().decode('utf-8')
28
click_files = [x for x in request.split('\n') if x]
30
for entry in click_files:
31
entry_parts = entry.split('_')
32
click_apps[entry_parts[0]] = entry_parts[1]
37
click_list = subprocess.check_output(
38
['adb', 'shell', 'sudo', '-iu', 'phablet',
39
'click', 'list']).decode('utf-8').split('\n')
40
click_entries = [x for x in click_list if x]
42
for entry in click_entries:
43
entry_parts = entry.split('\t')
44
click_apps[entry_parts[0]] = entry_parts[1].strip()
48
class ClickPreinstalled(unittest.TestCase):
51
self.image_list = get_image_list()
52
self.install_list = get_install_list()
53
print('Search for {} on image'.format(list(self.install_list.keys())))
55
def testPreinstalled(self):
56
for entry in self.install_list:
57
self.assertIn(entry, list(self.image_list.keys()))
60
if __name__ == '__main__':