feat: gen extensive test coverage #4
Draft
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.
Problem
showed many uncovered lines in
openfga_sdk/client/models/write_options.pyand its related dependency files (write_transaction_opts.pyandwrite_conflict_opts.py). Additionally, several write request model files lacked test coverage.Solution
Created a comprehensive test suite that provides maximum coverage for all targeted model files:
test/client/models/write_options_test.py- 36 test casestest/client/models/write_request_test.py- 22 test casestest/models/write_request_deletes_test.py- 22 test casestest/models/write_request_writes_test.py- 22 test casesCoverage Details
ClientWriteOptions (11 tests)
Tests all initialization scenarios, property getters, and setters:
WriteTransactionOpts (9 tests)
Tests default values, custom initialization, and all property setters:
ConflictOptions (16 tests)
Tests initialization with enum values and all property combinations:
ClientWriteRequest (22 tests)
Tests initialization, property getters/setters, and tuple key conversion methods:
WriteRequestDeletes (22 tests)
Tests initialization, validation, setters, and utility methods:
WriteRequestWrites (22 tests)
Tests initialization, validation, setters, and utility methods:
Test Results
The test suite covers all constructors, property getters, property setters, enum values, validation logic, utility methods (to_dict, eq, ne), and edge cases including None values.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.