Add edge case tests for ConfigReader#26
Conversation
Added comprehensive tests for `ConfigReader` covering: - Valid JSON files. - Empty directory. - No JSON files. - Invalid JSON file (JSONDecodeError). - Non-existent directory (FileNotFoundError). - Mixed valid and non-JSON files. Uses `pytest` and `tmp_path` fixture for isolation. Co-authored-by: mysticBliss <11345806+mysticBliss@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Remove module-level `sys.modules` patching in `tests/test_optimization.py` to prevent polluting global state for other tests (e.g., `tests/test_integration.py`). - Fix `DataMovements.py` to use `self._environments` (private attribute) instead of `self.environments` (non-existent). - Update `tests/test_data_movements.py` to assert on `dm.environment_configs` (public property) instead of `dm.environments`. - Correct `tests/test_data_flow_paths.py` to use valid Python expressions for `source_data_format` (e.g., `dt.strftime(...)`) as required by `DataFlow` evaluation logic. - Fix `tests/test_integration.py` to verify `count()` on the transformed mock DataFrame rather than the unused SQL return value. Co-authored-by: mysticBliss <11345806+mysticBliss@users.noreply.github.com>
- In PySpark 4.0+, `lit()` requires an active SparkContext. - The `test_integration.py` mocks `SparkSession` but does not establish a real SparkContext. - Added a patch for `datamov.core.engine.Engine.lit` in `test_engine_run` to prevent `AssertionError` during execution when real `pyspark` is installed. Co-authored-by: mysticBliss <11345806+mysticBliss@users.noreply.github.com>
Added edge case tests for
ConfigReader.read_json_filesindatamov/core/config_reader/ConfigReader.py.The new tests are located in
tests/test_config_reader.py.These tests ensure robustness of the configuration reading logic by covering scenarios like empty directories, invalid JSON, and mixed file types.
PR created automatically by Jules for task 13728690045468486932 started by @mysticBliss