Exemple #1
0
    def test_process_existing_unfetched_build(self, default_project, config, build):
        AppConnectBuild.objects.create(
            project=default_project,
            app_id=build.app_id,
            bundle_id=config.bundleId,
            platform=build.platform,
            bundle_short_version=build.version,
            bundle_version=build.build_number,
            uploaded_to_appstore=build.uploaded_date,
            first_seen=timezone.now(),
            fetched=False,
        )

        before = timezone.now()
        pending = process_builds(project=default_project, config=config, to_process=[build])

        assert len(pending) == 1

        (build, state) = pending[0]
        assert not state.fetched

        entry = LatestAppConnectBuildsCheck.objects.get(
            project=default_project, source_id=config.id
        )
        assert entry.last_checked >= before
Exemple #2
0
 def test_process_no_builds(self, default_project, config):
     before = timezone.now()
     pending = process_builds(project=default_project, config=config, to_process=[])
     assert not pending
     entry = LatestAppConnectBuildsCheck.objects.get(
         project=default_project, source_id=config.id
     )
     assert entry.last_checked >= before
Exemple #3
0
    def test_process_new_build(self, default_project, config, build):
        before = timezone.now()
        pending = process_builds(project=default_project, config=config, to_process=[build])
        assert len(pending) == 1

        (build, state) = pending[0]
        assert not state.fetched

        entry = LatestAppConnectBuildsCheck.objects.get(
            project=default_project, source_id=config.id
        )
        assert entry.last_checked >= before
Exemple #4
0
    def test_process_existing_fetched_build(self, default_project, config, build):
        AppConnectBuild.objects.create(
            project=default_project,
            app_id=build.app_id,
            bundle_id=config.bundleId,
            platform=build.platform,
            bundle_short_version=build.version,
            bundle_version=build.build_number,
            uploaded_to_appstore=build.uploaded_date,
            first_seen=timezone.now(),
            fetched=True,
        )

        before = timezone.now()
        newer_build = appconnect.BuildInfo(
            app_id="123",
            platform="iOS",
            version="3.1.9",
            build_number="20200224",
            uploaded_date=timezone.now(),
            dsym_url="http://iosapps.itunes.apple.com/itunes-assets/Purple116/v4/20/ba/a0/20baa026-2410-b32f-1fde-b227bc2ea7ae/appDsyms.zip?accessKey=very-cool-key",
        )

        pending = process_builds(
            project=default_project, config=config, to_process=[build, newer_build]
        )

        assert len(pending) == 1

        (build, state) = pending[0]
        assert not state.fetched
        assert state.bundle_version == "20200224"

        entry = LatestAppConnectBuildsCheck.objects.get(
            project=default_project, source_id=config.id
        )
        assert entry.last_checked >= before
Exemple #5
0
    def test_process_existing_fetched_build(self, default_project, config,
                                            build):
        AppConnectBuild.objects.create(
            project=default_project,
            app_id=build.app_id,
            bundle_id=config.bundleId,
            platform=build.platform,
            bundle_short_version=build.version,
            bundle_version=build.build_number,
            uploaded_to_appstore=build.uploaded_date,
            first_seen=timezone.now(),
            fetched=True,
        )

        before = timezone.now()
        newer_build = appconnect.BuildInfo(
            app_id="123",
            platform="iOS",
            version="3.1.9",
            build_number="20200224",
            uploaded_date=timezone.now(),
        )

        pending = process_builds(project=default_project,
                                 config=config,
                                 to_process=[build, newer_build])

        assert len(pending) == 1

        (build, state) = pending[0]
        assert not state.fetched
        assert state.bundle_version == "20200224"

        entry = LatestAppConnectBuildsCheck.objects.get(
            project=default_project, source_id=config.id)
        assert entry.last_checked >= before