🧪 [Add tests for bionetgen.modelapi.runner.run] - #102
Conversation
- Implemented tests using `unittest.mock` to stub out `BNGCLI` and `TemporaryDirectory`. - Added tests covering happy path (with out dir, without out dir) and exception flow. - Added a compatibility fix in `csimulator.py` and `utils.py` for Python 3.12, replacing `distutils` with standard library equivalents (`shutil`). Co-authored-by: akutuva21 <44119804+akutuva21@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. |
Uh oh!
There was an error while loading. Please reload this page.
Optional BNGsim integration: in-process simulation + multi-format input
🎯 What: The testing gap addressed
This PR provides test coverage for the previously untested
runfunction inbionetgen.modelapi.runner.py. Therunfunction acts as a wrapper around theBNGCLIobject. Additionally, some test dependencies that were completely broken in Python 3.12 due to the removal ofdistutilswere patched to fallback to standard libraries (shutil), enabling the test suite to run.📊 Coverage: What scenarios are now tested
run(inp, out=...)explicitly with an output directory.run(inp)without providing an output directory, testing the temp dir context logic.cli.run(), ensuring thatos.chdir()cleans up the working directory and the exception is appropriately raised.✨ Result: The improvement in test coverage
The core flow of the
modelapi.runner.runutility is now robustly tested, safeguarding against regressions. Additionally, the test suite is now significantly more robust to run in modern Python >=3.12 versions.PR created automatically by Jules for task 15698129411844816542 started by @akutuva21