Add property-based tests for JSON serialization, records, and state#11
Merged
Add property-based tests for JSON serialization, records, and state#11
Conversation
Add comprehensive property-based tests using Hypothesis to verify: - JSON serialization roundtrip (serialize -> deserialize preserves data) - JSON serialization determinism (consistent output for identical data) - Record validation with generated valid/invalid records - Key extraction correctness for scalar and compound keys - Tombstone detection and construction roundtrip - State computation with random sequences of put/delete operations - State invariants (no tombstones in final state, keys match records) Changes: - Create shared strategies.py module with reusable Hypothesis strategies - Rename test_key_comparison.py to test_key_properties.py for consistency - Add test_json_properties.py for serialization tests - Add test_record_properties.py for record validation tests - Add test_state_properties.py for state computation tests
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
CodSpeed Performance ReportMerging #11 will not alter performanceComparing Summary
Footnotes
|
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
strategies.pymodule with reusable Hypothesis strategies for JSONLT domain typestest_key_comparison.pytotest_key_properties.pyfor naming consistency across property test filesTest coverage
The new property-based tests verify:
JSON serialization (
test_json_properties.py)parse(serialize(obj)) == objjson.loadsRecord validation (
test_record_properties.py)State computation (
test_state_properties.py)Test plan