tests: Refactor and improve constants tests #888
Merged
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.



Refactor several test files for enum and constant classes to improve maintainability, consistency, and clarity. The main changes involve shifting from direct imports and usage of module-level constants/enums to storing them as class variables set up in
setUpClass(), and enhancing the tests to check type consistency and equality for enum members.Key improvements include:
setUpClassto initialize class variables for constants and enums.The most important changes are:
Test structure and setup improvements:
test_dte_constants.py,test_rcv_constants.py,test_rtc_constants.py, andtest_rut_constants.pyto usesetUpClass()and store constants/enums as class variables, promoting consistency and easier maintenance.Enum and constant validation enhancements:
intorstr) and to verify that enum members are equal to their values or names where appropriate.TipoDteandRcvTipoDocto) to confirm that enum members are also instances ofint, and that casting their values tointyields the member itself.Test code simplification:
Documentation and clarity:
TipoDteCediblesTestforTIPO_DTE_CEDIBLES.These changes collectively make the test suite more robust, readable, and maintainable.