Skip to content

Unit tests for apple_console.set_availability #17

Open

Description

@FidelisMM

Why

set_availability decides which countries an app is sold in. It upper-cases and de-duplicates the territory codes, then sends them to the console as a JS plan. Nothing tests that today.

What to do

Add tests to tests/test_apple_console.py, following the pattern of the set_privacy tests merged in #14: patch _run_iris, call the function, then read the generated JS.

  • Territories are upper-cased, de-duplicated and sorted (["bra", "USA", "bra"] → ["BRA", "USA"]).
  • available_in_new=True/False ends up as true/false in the request body.
  • The app_id is passed to _run_iris and appears in the request paths.
  • The return value of _run_iris is returned unchanged.

Done when

  • Tests for each case above, no network calls
  • CI is green

Getting started

No store credentials or test app needed.

uv sync
uv run python -m unittest discover -s tests -v

Comment here if you'd like to take it, so nobody duplicates the work. Questions are welcome in this thread, and PRs usually get a review within a day.

Activity

  1. GreedyC commented on Oct 13, 2026

    @GreedyC
    Contributor

    I'd like to take the offline set_availability tests. I'll patch _run_iris to verify normalized/sorted territory codes, both boolean values, app ID/path propagation and the unchanged return object, without contacting a store.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions