🧪 Add unit tests for sanctions CLI commands#38
🧪 Add unit tests for sanctions CLI commands#38mapleleaflatte03 wants to merge 3 commits intomainfrom
Conversation
Added `economy/tests/test_sanctions.py` to unit test `cmd_apply` and `cmd_lift`. Used `unittest.mock` to verify that `save_ledger` is correctly called only when `apply_sanction` or `lift_sanction` returns True. Also fixed a brittle hardcoded organization ID in `test_capsule_scoping.py` that caused test failures when run after local `quickstart.py` initialization. Co-authored-by: mapleleaflatte03 <240846662+mapleleaflatte03@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. |
Added `economy/tests/test_sanctions.py` to unit test `cmd_apply` and `cmd_lift`. Used `unittest.mock` to verify that `save_ledger` is correctly called only when `apply_sanction` or `lift_sanction` returns True. Also fixed a brittle hardcoded organization ID in `test_capsule_scoping.py` that caused test failures when run after local `quickstart.py` initialization. Co-authored-by: mapleleaflatte03 <240846662+mapleleaflatte03@users.noreply.github.com>
Added `economy/tests/test_sanctions.py` to unit test `cmd_apply` and `cmd_lift`. Used `unittest.mock` to verify that `save_ledger` is correctly called only when `apply_sanction` or `lift_sanction` returns True. Also fixed a brittle hardcoded organization ID in `test_capsule_scoping.py` that caused test failures when run after local `quickstart.py` initialization. Co-authored-by: mapleleaflatte03 <240846662+mapleleaflatte03@users.noreply.github.com>
|
This repository is now archived for historical reference.\n\nActive Meridian development has moved to the monorepo:\nhttps://github.com/mapleleaflatte03/meridian\n\nPlease open a new PR against the monorepo if this change is still needed. |
🎯 What: The testing gap addressed
The
cmd_applyfunction ineconomy/sanctions.py(and the relatedcmd_liftfunction) lacked unit tests.📊 Coverage: What scenarios are now tested
cmd_apply: validates that whenapply_sanctionreturns True,load_ledger,apply_sanction, andsave_ledgerare called correctly.cmd_apply: validates that whenapply_sanctionreturns False,save_ledgeris bypassed.cmd_lift: validates that whenlift_sanctionreturns True,load_ledger,lift_sanction, andsave_ledgerare called correctly.cmd_lift: validates that whenlift_sanctionreturns False,save_ledgeris bypassed.✨ Result: The improvement in test coverage
The CLI commands in
economy/sanctions.pyare now fully unit tested for their routing and save logic. Also fixed a brittle test intest_capsule_scoping.pythat assumed a hardcoded founding org ID which caused test failures.PR created automatically by Jules for task 13149159199046579460 started by @mapleleaflatte03