tests: add reproducer for fetch-lib unhelpful error message (#2204)
Metadata
Current evaluation
Resolves an unhelpful error message in charmcraft fetch-lib that incorrectly displays Library None for unregistered libraries, with the fix now applied.
Suggested action: needs review
Reason: The PR contains a clear reproducer and a proposed fix for a valid bug. It requires maintainer review to validate the AI-generated changes and merge. Although inactive for ~2 months, the bug remains relevant and the PR is ready for technical assessment.
Staleness:
55
Complexity:
15
Confidence:
80
Issue body
## Summary
Adds a failing unit test that reproduces #2204: `charmcraft fetch-lib` prints the unhelpful message `Library None not found in Charmhub.` when a library's `lib_id` is not registered in Charmhub.
## Bug
When fetching all libs (no argument), `parsed_args.library` is `None`. When the Charmhub bulk API returns no entry for a local/unpublished library's `lib_id`, the error uses `parsed_args.library` directly, producing `"Library None not found in Charmhub."` instead of a meaningful identifier.
## Reproducer
```
uv run python -m pytest tests/unit/commands/test_store.py::test_fetch_lib_command_unregistered_lib_id_error_message -v
```
The test fails with:
```
AssertionError: Bug reproduced: error message uses 'None' instead of library name:
'Library None not found in Charmhub.'
```
Closes #2204
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| 2026-06-15 11:53:46.253607+00:00 | qwen3.6-35b-a3b-mtp-q6 |
Staleness:
55
Complexity:
15
Confidence:
80
|
needs review | Resolves an unhelpful error message in charmcraft fetch-lib that incorrectly displays Library None for unregistered libraries, with the fix now applied. |
| 2026-06-15 11:40:51.160435+00:00 | pending | — | — | — |