def test_multi_bundle_mixed_urls(self) -> None: url = "http://iosapps.itunes.apple.com/itunes-assets/very-real-url" bundles = [ { "type": "buildBundles", "id": "59467f37-371e-4755-afcd-0116775a6eab", "attributes": { "bundleType": "APP", "dSYMUrl": url, }, }, { "type": "buildBundles", "id": "5e231f58-31c6-47cc-b4f8-56952d44a158", "attributes": { "bundleType": "APP", "dSYMUrl": None, }, }, ] assert appstore_connect._get_dsym_url(bundles) == url bundles.reverse() assert appstore_connect._get_dsym_url(bundles) is NoDsymUrl.NOT_NEEDED
def test_multi_bundle_has_url(self) -> None: first_url = "http://iosapps.itunes.apple.com/itunes-assets/very-real-url" second_url = "http://iosapps.itunes.apple.com/itunes-assets/very-fake-url" bundles = [ { "type": "buildBundles", "id": "59467f37-371e-4755-afcd-0116775a6eab", "attributes": { "bundleType": "APP", "dSYMUrl": first_url, }, }, { "type": "buildBundles", "id": "5e231f58-31c6-47cc-b4f8-56952d44a158", "attributes": { "bundleType": "APP", "dSYMUrl": second_url, }, }, ] assert appstore_connect._get_dsym_url(bundles) == first_url bundles.reverse() assert appstore_connect._get_dsym_url(bundles) == second_url
def test_one_bundle_strange_url(self) -> None: bundles = [{ "type": "buildBundles", "id": "59467f37-371e-4755-afcd-0116775a6eab", "attributes": { "bundleType": "APP", "dSYMUrl": 1, }, }] with pytest.raises(ValueError): appstore_connect._get_dsym_url(bundles)
def test_multi_bundle_appclip_mixed_clip_no_url(self) -> None: url = "http://iosapps.itunes.apple.com/itunes-assets/very-real-url" bundles = [ { "type": "buildBundles", "id": "59467f37-371e-4755-afcd-0116775a6eab", "attributes": { "bundleType": "APP", "dSYMUrl": None, }, }, { "type": "buildBundles", "id": "59467f37-371e-4755-afcd-1227886b7fbc", "attributes": { "bundleType": "APP_CLIP", "dSYMUrl": url, }, }, ] with mock.patch("sentry_sdk.capture_message") as capture_message: assert appstore_connect._get_dsym_url( bundles) is NoDsymUrl.NOT_NEEDED assert capture_message.call_count == 1
def test_one_bundle_no_url(self) -> None: bundles = [{ "type": "buildBundles", "id": "59467f37-371e-4755-afcd-0116775a6eab", "attributes": { "bundleType": "APP", "dSYMUrl": None, }, }] assert appstore_connect._get_dsym_url(bundles) is NoDsymUrl.NOT_NEEDED
def test_one_bundle_has_url(self) -> None: url = "http://iosapps.itunes.apple.com/itunes-assets/very-real-url" bundles = [{ "type": "buildBundles", "id": "59467f37-371e-4755-afcd-0116775a6eab", "attributes": { "bundleType": "APP", "dSYMUrl": url, }, }] assert appstore_connect._get_dsym_url(bundles) == url
def test_multi_bundle_no_url(self) -> None: bundles = [ { "type": "buildBundles", "id": "59467f37-371e-4755-afcd-0116775a6eab", "attributes": { "bundleType": "APP", "dSYMUrl": None, }, }, { "type": "buildBundles", "id": "5e231f58-31c6-47cc-b4f8-56952d44a158", "attributes": { "bundleType": "APP", "dSYMUrl": None, }, }, ] assert appstore_connect._get_dsym_url(bundles) is NoDsymUrl.NOT_NEEDED
def test_empty_bundle_list(self) -> None: assert appstore_connect._get_dsym_url([]) is NoDsymUrl.NOT_NEEDED
def test_none_bundles(self) -> None: assert appstore_connect._get_dsym_url(None) is NoDsymUrl.NOT_NEEDED