def set_up_mocks(monkeypatch_, edit_service_mock_): monkeypatch_.setattr( googleplay, 'EditService', lambda _, __, ___, commit, contact_google_play: edit_service_mock_) monkeypatch_.setattr(apk, 'check_if_apk_is_multilocale', lambda _: None) monkeypatch_.setattr(apk, 'check_if_apk_has_claimed_architecture', lambda _, __: None) set_translations_per_google_play_locale_code(monkeypatch_)
def test_do_not_contact_google_play_flag_does_not_request_google_play( monkeypatch): monkeypatch.setattr(apk, 'check_if_apk_is_multilocale', lambda _: None) monkeypatch.setattr(apk, 'check_if_apk_has_claimed_architecture', lambda _, __: None) set_translations_per_google_play_locale_code(monkeypatch) config = copy(VALID_CONFIG) config['do_not_contact_google_play'] = True PushAPK(config).run()
def test_do_not_contact_google_play_flag_does_not_request_google_play( monkeypatch): monkeypatch.setattr( extractor, 'extract_metadata', lambda _: { 'package_name': 'org.mozilla.firefox', 'version_code': '1', }) monkeypatch.setattr(checker, 'cross_check_apks', lambda _: None) set_translations_per_google_play_locale_code(monkeypatch) config = copy(VALID_CONFIG) config['do_not_contact_google_play'] = True PushAPK(config).run()
def test_do_not_contact_google_play_flag_does_not_request_google_play( monkeypatch): monkeypatch.setattr( extractor, 'extract_metadata', lambda _, __: { 'package_name': 'org.mozilla.firefox', 'version_code': '1', }) monkeypatch.setattr(checker, 'cross_check_apks', lambda _, __, ___, ____, _____, ______: None) set_translations_per_google_play_locale_code(monkeypatch) push_apk(APKS, SERVICE_ACCOUNT, credentials, 'alpha', AnyPackageNamesCheck(), contact_google_play=False)
def set_up_mocks(monkeypatch_, edit_service_mock_): def _metadata(apk_file_name): if apk_file_name == apk_arm.name: version_code = '0' architecture = 'armeabi-v7a' elif apk_file_name == apk_x86.name: version_code = '1' architecture = 'x86' return { 'architecture': architecture, 'firefox_build_id': '20171112125738', 'version_code': version_code, 'package_name': 'org.mozilla.firefox', 'locales': ( 'an', 'ar', 'as', 'ast', 'az', 'be', 'bg', 'bn-IN', 'br', 'ca', 'cak', 'cs', 'cy', 'da', 'de', 'dsb', 'el', 'en-GB', 'en-US', 'en-ZA', 'eo', 'es-AR', 'es-CL', 'es-ES', 'es-MX', 'et', 'eu', 'fa', 'ff', 'fi', 'fr', 'fy-NL', 'ga-IE', 'gd', 'gl', 'gn', 'gu-IN', 'he', 'hi-IN', 'hr', 'hsb', 'hu', 'hy-AM', 'id', 'is', 'it', 'ja', 'ka', 'kab', 'kk', 'kn', 'ko', 'lo', 'lt', 'lv', 'mai', 'ml', 'mr', 'ms', 'my', 'nb-NO', 'nl', 'nn-NO', 'or', 'pa-IN', 'pl', 'pt-BR', 'pt-PT', 'rm', 'ro', 'ru', 'sk', 'sl', 'son', 'sq', 'sr', 'sv-SE', 'ta', 'te', 'th', 'tr', 'uk', 'ur', 'uz', 'wo', 'xh', 'zam', 'zh-CN', 'zh-TW', ), 'api_level': 16, 'firefox_version': '57.0' } monkeypatch_.setattr( googleplay, 'EditService', lambda _, __, ___, commit, contact_google_play: edit_service_mock_) monkeypatch_.setattr(extractor, 'extract_metadata', _metadata) monkeypatch_.setattr(checker, 'cross_check_apks', lambda _: None) set_translations_per_google_play_locale_code(monkeypatch_)