Repository navigation
feat(mnemonic): add property-based tests for invalid cases - #3132
Conversation
There was a problem hiding this comment.
Pull Request Overview
Add property-based tests for mnemonic validation using Hypothesis to test invalid mnemonic files and CLI error handling. This improves test coverage for edge cases and malformed input scenarios.
- Introduced comprehensive property-based testing strategies for invalid mnemonic cases including wrong word counts, unknown words, encoding issues, and filesystem edge cases
- Refactored existing test parametrization to use shared constants for allowed mnemonic sizes
- Added new test class for negative cases that validates CLI error handling for malformed mnemonic files
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cardano_node_tests/tests/test_mnemonic.py | Added property-based test infrastructure with Hypothesis strategies for invalid mnemonic cases and new negative test class |
| cardano_node_tests/tests/common.py | Added filter_too_much health check suppression to hypothesis_settings for property-based tests |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
51d844d to
e28205a
Compare
Introduce property-based tests for mnemonic file validation using Hypothesis. Covers malformed files, invalid word counts, encoding issues, and permission errors. Refactor test parametrization to use shared constants. Improves robustness of CLI error handling for mnemonic derivation.
e28205a to
43e8e59
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Add property-based tests for `derive_from_mnemonic` to verify acceptance of valid account numbers and rejection of invalid account/key numbers. Includes hypothesis-based checks for boundary values and invalid types.
43e8e59 to
4e7ce5e
Compare
Refactor property-based tests for mnemonic generation to better handle invalid word counts. Ensures zero is excluded from wrong count cases and removes redundant hypothesis assumptions. This enhances test clarity and coverage for edge cases.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Introduce property-based tests for mnemonic file validation using Hypothesis. Covers malformed files, invalid word counts, encoding issues, and permission errors. Refactor test parametrization to use shared constants. Improves robustness of CLI error handling for mnemonic derivation.