Skip to content

Run the examples in CI with mocked network calls #20

Description

@TheCoder30ec4

Problem

The examples aren't tested, so an API change can break them without anyone noticing (for example when Router became keyword-only).

Proposal

Add tests/test_examples.py:

  • import examples/basic.py and examples/agent.py
  • patch model_router.router.fetch_catalog, model_router.jev.request_json and the chat call
  • run each main() with a fake key set in the environment

Done when

  • Both examples run offline in CI
  • Tests fail if an example uses an API that doesn't exist

Activity

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

    area: ciGitHub Actions, packaging and releasesgood first issueGood for newcomerstestsTest coverage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions