Add unit tests for Observable, Tier, and Direction types#46
Merged
jc-macdonald merged 4 commits intomainfrom Apr 9, 2026
Merged
Add unit tests for Observable, Tier, and Direction types#46jc-macdonald merged 4 commits intomainfrom
jc-macdonald merged 4 commits intomainfrom
Conversation
Test enum membership, values, identity, and invalid-value errors for Tier and Direction. Test Observable field access, frozen immutability, equality, hashing (set/dict usage), repr, and edge case where duplicate names with different tiers are distinct.
Python 3.11 is incompatible with requires-python >= 3.12. Coverage threshold was 80% in CI but 40% in justfile; align to 40%.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Unit tests for the core value types in
protocols.py:Tier,Direction, andObservable.Closes #1
Changes
1. Fix pre-existing E501 in
__init__.pyModule docstring exceeded 88-char line limit; split to multi-line.
2. Add uv.lock to .gitignore
uv.lockwas tracked but should not be; added to.gitignoreand removed from index.3. Tests for
TierandDirectionenums.valuestrings match expected identifiersTier("embedded")) returns the correct singletonValueErroris) holds4. Tests for
Observablefrozen dataclassAttributeErrorsetand asdictkeyreprincludes all field valuesStats
tests/test_protocols.pyjust cipasses (format, lint, mypy strict, coverage)