コード例 #1
0
    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
コード例 #2
0
    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
コード例 #3
0
    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)
コード例 #4
0
    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
コード例 #5
0
    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
コード例 #6
0
    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
コード例 #7
0
    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
コード例 #8
0
 def test_empty_bundle_list(self) -> None:
     assert appstore_connect._get_dsym_url([]) is NoDsymUrl.NOT_NEEDED
コード例 #9
0
 def test_none_bundles(self) -> None:
     assert appstore_connect._get_dsym_url(None) is NoDsymUrl.NOT_NEEDED