Exemple #1
0
    def test_craft_push_config_allows_to_contact_google_play_or_not(self):
        self.context.task['scopes'] = ['project:releng:googleplay:aurora']
        config = craft_push_apk_config(self.context, self.apks)
        self.assertNotIn('do_not_contact_google_play', config)

        self.context.task['scopes'] = ['project:releng:googleplay:dep']
        config = craft_push_apk_config(self.context, self.apks)
        self.assertTrue(config['do_not_contact_google_play'])
Exemple #2
0
 def test_craft_push_config_updates_google(self):
     config = craft_push_apk_config(
         self.context,
         self.apks,
         google_play_strings_path='/path/to/google_play_strings.json')
     self.assertNotIn('no_gp_string_update', config)
     self.assertEqual(config['update_gp_strings_from_file'],
                      '/path/to/google_play_strings.json')
Exemple #3
0
 def test_craft_push_config_allows_rollout_percentage(self):
     self.context.task['payload']['google_play_track'] = 'rollout'
     self.context.task['payload']['rollout_percentage'] = 10
     self.assertEqual(
         craft_push_apk_config(self.context, self.apks), {
             '*args': ['/path/to/arm_v15.apk', '/path/to/x86.apk'],
             'credentials': '/path/to/release.p12',
             'commit': False,
             'no_gp_string_update': True,
             'rollout_percentage': 10,
             'service_account': 'release_account',
             'track': 'rollout',
         })
Exemple #4
0
 def test_craft_push_config(self):
     android_products = ('aurora', 'beta', 'release')
     for android_product in android_products:
         self.context.task['scopes'] = [
             'project:releng:googleplay:{}'.format(android_product)
         ]
         self.assertEqual(
             craft_push_apk_config(self.context, self.apks), {
                 '*args': ['/path/to/arm_v15.apk', '/path/to/x86.apk'],
                 'credentials': '/path/to/{}.p12'.format(android_product),
                 'commit': False,
                 'no_gp_string_update': True,
                 'service_account': '{}_account'.format(android_product),
                 'track': 'alpha',
             })
Exemple #5
0
 def test_craft_push_config_allows_committing_apks(self):
     self.context.task['scopes'] = ['project:releng:googleplay:aurora']
     self.context.task['payload']['commit'] = True
     config = craft_push_apk_config(self.context, self.apks)
     self.assertTrue(config['commit'])