def test_valid_version_from_gplay(self, get_apk_info): latest_gplay = {"version_code": 20200901, "version": "0.123.4"} autosearch_latest = {"version": "0.123.4", "url": 20201001} get_apk_info_resp = ("0.123.4", "com.ignored") get_apk_info.return_value = get_apk_info_resp with GetStorage(get_connection_api()) as storage: package_downloader = APKWizard(storage.db_wrapper, storage.storage_manager) package_downloader.find_latest_pogo = MagicMock( return_value=latest_gplay) storage.storage_manager.get_current_version = MagicMock( return_value="0.123.3") package_downloader.get_latest = MagicMock( return_value=autosearch_latest) GPlayConnector.download = MagicMock( return_value=TEST_GPLAY_RESPONSE) package_downloader.download_pogo(APKArch.arm64_v8a)
def test_invalid_version_from_gplay(self, get_apk_info, supported_pogo_version): supported_pogo_version.return_value = True get_apk_info.return_value = ("0.123.3", "com.ignored") latest_gplay = { "version_code": 20200901, "version": "0.123.4" } autosearch_latest = { "version": "0.123.4", "url": 20201001 } with GetStorage(get_connection_api()) as storage: package_downloader = APKWizard(storage.db_wrapper, storage.storage_manager) package_downloader.find_latest_pogo = MagicMock(return_value=latest_gplay) storage.storage_manager.get_current_version = MagicMock(return_value=None) package_downloader.get_latest = MagicMock(return_value=autosearch_latest) GPlayConnector.download = MagicMock(return_value=TEST_GPLAY_RESPONSE) with self.assertRaises(InvalidDownload): package_downloader.download_pogo(APKArch.arm64_v8a)