🧪 Bolt: Add missing unit tests for runner.run function - #43
Conversation
Adds a comprehensive test suite to cover the core scenarios of the `runner.run()` function in `bionetgen/modelapi/runner.py`. The tests verify proper argument delegation to `BNGCLI` and correctly test output folder creation using temp directories and exception handling while isolating external effects using `unittest.mock`. 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. |
Adds a comprehensive test suite to cover the core scenarios of the `runner.run()` function in `bionetgen/modelapi/runner.py`. The tests verify proper argument delegation to `BNGCLI` and correctly test output folder creation using temp directories and exception handling while isolating external effects using `unittest.mock`. Fixes Black formatting issues as per CI requirements. Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>
akutuva21
commented
Apr 13, 2026
Superseded by merged #102 runner tests. |
Understood. Acknowledging that this work is superseded and stopping work on this task. |
🎯 What: This PR introduces a new test file
tests/test_runner.pycontaining comprehensive unit tests for therunner.run()function inbionetgen/modelapi/runner.py. Therunfunction lacked test coverage despite being the primary entry point for executing BNG2.pl as a library.📊 Coverage: The tests use
unittest.mockto mock outBNGCLI,os.chdir, andTemporaryDirectory, providing safe, deterministic test coverage for the following scenarios:runcalled with a specifiedoutdirectory.runcalled without anoutdirectory, correctly falling back to generating a temporary directory.BNGCLI.run()raises an exception with anoutdirectory.BNGCLI.run()raises an exception using a temporary directory.✨ Result: The test coverage for the
bionetgen/modelapi/runner.pymodule is significantly improved. Future refactoring can proceed with confidence that the core execution and fallback logic is protected by automated tests.PR created automatically by Jules for task 11391169183500655460 started by @akutuva21