~canonical-platform-qa/ubuntu-system-tests/trying-reproduce-timeout-issue

« back to all changes in this revision

Viewing changes to ubuntu_system_tests/helpers/application.py

  • Committer: Tarmac
  • Author(s): Heber Parrucci
  • Date: 2016-11-04 14:58:31 UTC
  • mfrom: (475.1.5 fixing-list-tests)
  • Revision ID: tarmac-20161104145831-k4c8overpkq8crml
Fixing issue when listing ubuntu system tests:

autopilot3 list ubuntu_system_tests.tests.

Approved by Richard Huddie, platform-qa-bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
 
90
90
    def is_installed(self, _id=None):
91
91
        try:
92
 
            subprocess.check_output(['dpkg', '-l', _id or self.app_id],
93
 
                                    universal_newlines=True).splitlines()
94
 
            return True
 
92
            _id = _id or self.app_id
 
93
            apps = subprocess.check_output(
 
94
                ['ubuntu-app-launch-appids'],
 
95
                universal_newlines=True,
 
96
                stderr=subprocess.DEVNULL).splitlines()
 
97
            return any(app.startswith(_id) for app in apps)
95
98
        except subprocess.CalledProcessError:
96
99
            return False
97
100