Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cueapi/cueapi-cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: cueapi/cueapi-cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: test/cli-integration-tests
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Apr 20, 2026

  1. test(cli): add 13 integration tests for CLI → API contract

    Before this, tests/test_cli.py was exclusively help-text and
    argument-parsing assertions via Click's CliRunner — zero tests
    exercised the HTTP call the CLI makes. A breaking change in
    cueapi-core or the httpx client code path could land with full
    green CI.
    
    Approach: patch cueapi.cli.CueAPIClient with a MagicMock that
    mimics the context-manager protocol, assert on the resulting
    .post/.get/.patch.call_args. Preserves full CLI code path
    (flag parsing, body/schedule construction, error handling) and
    only mocks the network boundary.
    
    Coverage added:
    - create: recurring cron → POST /cues body, one-time `--at` →
      "once" schedule, --worker omits callback, --payload JSON
      parsed into body, --on-failure JSON parsed, invalid --payload
      JSON rejected before any HTTP call, HTTP 403 surfaces the
      "cueapi upgrade" hint
    - list: default params, filters (--status/--limit/--offset)
    - pause/resume: PATCH /cues/{id} with correct {"status": "..."}
    - update: patches correct path + body, "no fields" errors before
      calling the API
    
    Tests: 32/32 pass (was 19/19).
    
    Why inline --api-key instead of monkey-patching credentials:
    using the existing --api-key flag is already the supported
    "bypass config file" path; tests stay close to how a user or
    CI script would run the command.
    Gk authored and Gk committed Apr 20, 2026
    Configuration menu
    Copy the full SHA
    8c6d0a6 View commit details
    Browse the repository at this point in the history
Loading