Draft
Conversation
Installs factory_boy and sets up initial factories for common data structures.
Key changes:
- Added `factory_boy` to dev dependencies.
- Created `smart_control/utils/factory_utils.py` containing factories for:
- Protobuf messages: `ActionRequest`, `SingleActionRequest`, `ObservationResponse`, `SingleObservationResponse`, `ObservationRequest`, `SingleObservationRequest`.
- Custom classes: `SimpleBuilding` (from environment_test_utils), `MaterialProperties`, `Building` (deprecated simulator building), and `FloorPlanBasedBuilding`.
- Refactored tests in `smart_control/environment/environment_test.py` to use `ActionRequestFactory` and `SimpleBuildingFactory`.
- Refactored tests in `smart_control/simulator/building_test.py` (`test_init_direct_attributes` and `test_init_direct_attributes_post_refactor`) to use `DeprecatedBuildingFactory` and `FloorPlanBasedBuildingFactory`.
- Added `smart_control/utils/factory_utils_test.py` with examples demonstrating how to create object variations using the new factories.
- Updated `smart_control/utils/BUILD` to include targets for the new factory utilities and tests.
- Added documentation to `README.md` on how to use and create factories with `factory_boy` in this project.
These changes make it easier to create and manage test data, improving the clarity and maintainability of tests.
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.
feat: Introduce factory_boy for test fixtures
Installs factory_boy and sets up initial factories for common data structures.
Key changes:
factory_boyto dev dependencies.smart_control/utils/factory_utils.pycontaining factories for:ActionRequest,SingleActionRequest,ObservationResponse,SingleObservationResponse,ObservationRequest,SingleObservationRequest.SimpleBuilding(from environment_test_utils),MaterialProperties,Building(deprecated simulator building), andFloorPlanBasedBuilding.smart_control/environment/environment_test.pyto useActionRequestFactoryandSimpleBuildingFactory.smart_control/simulator/building_test.py(test_init_direct_attributesandtest_init_direct_attributes_post_refactor) to useDeprecatedBuildingFactoryandFloorPlanBasedBuildingFactory.smart_control/utils/factory_utils_test.pywith examples demonstrating how to create object variations using the new factories.smart_control/utils/BUILDto include targets for the new factory utilities and tests.README.mdon how to use and create factories withfactory_boyin this project.These changes make it easier to create and manage test data, improving the clarity and maintainability of tests.
Fixes #<issue_number_goes_here>