Skip to content

Add a smoke test for the AVAILABLE_MODELS schema #9

@DevanshSrajput

Description

@DevanshSrajput

Context

The existing AppHelpersModuleTests already asserts the
catalogue has no banned ids, every entry has the required
fields, and list_model_choices() orders Free first. A
new contributor can still introduce subtle bugs: duplicate
ids, multiple Free entries marked as the default, a tier
value that's neither "Free" nor "Paid", or a performance
rating that breaks the existing 3-star scheme. A single
test_catalogue_is_well_formed smoke test catches all of
these in one go.

What to change
Add one test method to AppHelpersModuleTests in
tests/test_agent.py that asserts:

  • No two entries in AVAILABLE_MODELS share a name field.
  • tier is one of {"Free", "Paid"} for every entry.
  • performance matches r"^⭐+$" (one or more star emojis).
  • description is non-empty for every entry.
  • Exactly one entry has tier == "Free" AND is the
    DEFAULT_MODEL_ID (locks the "implicit default" contract
    from G9).

How to verify

  • The new test passes on the current catalogue.
  • Mutating the catalogue to break any rule makes the test
    fail with a precise error message.
  • python -m unittest tests.test_agent.AppHelpersModuleTests -v
    is green.

Skill: schema validation, fixture design.
Estimated effort: S.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions