~nskaggs/ubuntu-calendar-app/dev3

« back to all changes in this revision

Viewing changes to tests/autopilot/address_book_service_testability/fixture_setup.py

  • Committer: nskaggs
  • Date: 2014-07-31 19:53:11 UTC
  • mto: This revision was merged to the branch mainline in revision 375.
  • Revision ID: nicholas.skaggs@canonical.com-20140731195311-w9iin4t6jz3tc8lo
add more logging to fixture_setup, fix typo to return proper location

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
        local_location = os.path.join(
83
83
            local_location,
84
84
            'tests/autopilot/address_book_service_testability/data/vcard.vcf')
 
85
        phablet_location = 'address_book_service_testability/data/vcard.vcf'
85
86
        bin_location = '/usr/share/address-book-service/data/vcard.vcf'
86
87
        cal_location = os.path.join('/usr/lib/python2.7/dist-packages/',
87
88
                                    'address_book_service_testability/data/',
88
89
                                    'vcard.vcf')
89
90
        if os.path.exists(local_location):
 
91
            print('Using %s for vcard' % local_location)
90
92
            return local_location
 
93
        elif os.path.exists(phablet_location):
 
94
            print('Using %s for vcard' % phablet_location)
 
95
            return phablet_location
 
96
        elif os.path.exists(cal_location):
 
97
            print('Using %s for vcard' % cal_location)
 
98
            return cal_location
91
99
        elif os.path.exists(bin_location):
92
 
            return bin_location
93
 
        elif os.path.exists(cal_location):
 
100
            print('Using %s for vcard' % bin_location)
94
101
            return bin_location
95
102
        else:
96
 
            raise RuntimeError('No VCARD found in %s or %s or %s' %
97
 
                               (local_location, bin_location, cal_location))
 
103
            raise RuntimeError('No VCARD found in %s or %s or %s or %s' %
 
104
                               (local_location, bin_location,
 
105
                                cal_location, phablet_location))
98
106
 
99
107
 
100
108
class RestartService(Fixture):