Closed sweep-ai[bot] closed 10 months ago
The command:
Run pipenv run mypy pulling_ace/**/*.py
yielded the following error:
##[error]Process completed with exit code 2.
Here are the logs:
pulling_ace/utils/subprocessor.py: error: Source file found twice under different module names: "pulling_ace.pulling_ace.utils.subprocessor" and "pulling_ace.utils.subprocessor"
Found 1 error in 1 file (errors prevented further checking)
I wasn't able to make changes. This could be due to an unclear request or a bug in my code. As a reminder, comments on a file only modify that file. Comments on a PR (at the bottom of the "conversation" tab) can modify the entire PR. Please try again or contact us on Discord
PR Feedback (click)
I created this PR to address this rule:
"Code should not be committed without proper testing."
Description
This PR adds unit tests for the functions in the
subprocessor.py
file in thepulling_ace/utils
directory. The code changes in the file were not properly tested before committing, so this PR aims to address that by adding comprehensive unit tests for each function.Summary of Changes
toxicity
function to ensure it correctly validates the probe and executes the command as expected.promptinjection
function to ensure it correctly validates the probe and executes the command as expected.riskcards
function to ensure it correctly validates the probe and executes the command as expected.riskcard_wrapper
,promptinjection_wrapper
, andtoxicity_wrapper
functions to ensure they correctly call the corresponding functions with the provided arguments.run_injections
function to ensure it correctly runs the probes based on the specified probe family.These unit tests cover various scenarios, including valid and invalid probes, and valid and invalid probe families.
Please review and merge this PR to ensure proper testing of the code changes in
subprocessor.py
.