feat: Add CD001-Tools-002- Tools- Payment: add unit tests for payment…#279
Open
steadhac wants to merge 1 commit into
Open
feat: Add CD001-Tools-002- Tools- Payment: add unit tests for payment…#279steadhac wants to merge 1 commit into
steadhac wants to merge 1 commit into
Conversation
24f03fb to
c16f6b2
Compare
… tools with bug and security coverage - Add 42 tests across 10 classes covering all 4 functions in payment.py: get_invoice_for_payment, process_payment, get_vendor_payment_summary, update_payment_agent_notes - Document 7 bugs as failing tests (PAY-PROC-007/008/009, PAY-NOTES-005/006, PAY-FIELD-001/002): None inputs written as literal None, empty string payment_method accepted silently, misleading error message on update failure, and AttributeError crash when invoice dates are null - Add 6 prompt injection tests (PAY-INJ-001 to PAY-INJ-006) confirming the code-level status check cannot be bypassed by urgency words in agent_notes, description, or invoice_number — and documenting that injected text is returned verbatim to the PaymentAgent LLM
c16f6b2 to
774abbb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a full unit test suite for the payment tools layer — invoice retrieval for payment,
payment processing, vendor payment summaries, and agent notes management.
Bug-exposing tests document confirmed production defects: None inputs written as literal
"None", empty string payment_method accepted silently, misleading error message on update
failure, and AttributeError crash when invoice dates are null.
Prompt injection tests document the LLM attack surface via string fields — confirming
the code-level status check cannot be bypassed by urgency words or "APPROVED" keywords
in agent_notes, description, or invoice_number.
Tests follow the established pattern with:
📁 Test Files
tests/unit/tools/test_payment.py
TestGetInvoiceForPayment
TestProcessPayment
TestGetVendorPaymentSummary
TestUpdatePaymentAgentNotes
TestProcessPaymentBugs⚠️
TestUpdatePaymentAgentNotesBugs⚠️
TestIntFieldEdgeCases
TestStrFieldEdgeCases
TestMissingInvoiceFields⚠️
TestPromptInjection 🔒
Related Bug Tickets
Bug_102, Bug_103, Bug_104, Bug_105, Bug_106, Bug_107, Bug_108