Adding more tests scenarios for battle model#157
Merged
coxmars merged 1 commit intoAkatsukiLabs:mainfrom Jun 29, 2025
Merged
Conversation
Contributor
Author
|
For the |
Contributor
Got it, no problem. Thanks for the help it looks good 🫡 |
coxmars
approved these changes
Jun 29, 2025
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.
Pull Request Overview
📝 Summary
More tests cases for Battle model.
Related Issues
Type of Change
Mark with an
xall the checkboxes that apply (like[x]).🔧 Tests Results
Based on the current
battle.cairofile, here are the test cases implemented:Battle State Management:
test_end()- Verifies battle ending sets correct winner and statustest_is_active()/test_is_finished()- Tests initial battle state checkstest_is_finished_after_end()- Confirms status changes after battle completiontest_battle_status_transitions()- Tests full status flow (Waiting → Finished)Turn Management:
test_switch_turn()- Basic turn switching functionalitytest_switch_turn_multiple_times()- Multiple consecutive turn switchestest_switch_turn_alternates_correctly()- Proper player alternation logicEdge Cases & Data Integrity:
test_battle_with_zero_addresses()- Handles zero contract addressestest_battle_consistency_after_operations()- Ensures immutable fields stay unchanged after operationsCoverage: 9 active tests covering battle lifecycle, turn management, status validation, and data consistency. One timestamp test remains commented out.
Test Coverage
Evidence