Skip to content

Add unit tests for Annotation.resolve()#47

Merged
jc-macdonald merged 1 commit intomainfrom
test/issue-3-annotation-resolve
Apr 9, 2026
Merged

Add unit tests for Annotation.resolve()#47
jc-macdonald merged 1 commit intomainfrom
test/issue-3-annotation-resolve

Conversation

@jc-macdonald
Copy link
Copy Markdown
Contributor

Summary

Unit tests for Annotation.resolve() covering dict-based and callable-based resolution, plus error paths.

Closes #3

Changes

  • Dict lookup: resolves correct value for a given config key
  • Dict lookup (all keys): iterates all entries to confirm correctness
  • Callable lookup: lambda-based resolution returns expected value
  • Float coercion: confirms resolve() returns float even when callable returns int
  • Missing config key: raises KeyError when the config dict lacks the annotation key
  • Missing lookup key: raises KeyError when the lookup dict lacks the resolved value

Stats

  • 6 new tests (26 total)
  • protocols.py coverage: 91% → 100%
  • Total coverage: 55.73% → 60.41%
  • just ci passes (format, lint, mypy strict, coverage)

Test dict-based and callable-based annotation resolution, float return
type coercion, missing config key (KeyError), and missing lookup key
(KeyError).  Covers Annotation.resolve fully — protocols.py now at 100%.

Closes #3
@jc-macdonald jc-macdonald merged commit 7f80054 into main Apr 9, 2026
3 checks passed
@jc-macdonald jc-macdonald deleted the test/issue-3-annotation-resolve branch April 9, 2026 17:45
@jc-macdonald jc-macdonald added test Test coverage improvement protocols protocols.py module labels Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

protocols protocols.py module test Test coverage improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unit tests for Annotation.resolve()

1 participant