Adaptar poweremail_signaturit a refactor y a multicompany#62
Adaptar poweremail_signaturit a refactor y a multicompany#62
Conversation
Test Results 2 files 2 suites 0s ⏱️ For more details on these failures and errors, see this check. Results for commit 4a57b59. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull Request Overview
This PR adapts the poweremail_signaturit module to support a refactored Signaturit integration and multicompany functionality. The main change is migrating from a global get_signaturit_client() function to instance methods that can determine the appropriate Signaturit credentials based on the company associated with each poweremail account.
Key Changes
- Refactored client acquisition: Moved from global
get_signaturit_client()function to instance methods inPoweremailCoreandPoweremailMailboxclasses that support multicompany environments - Backward compatibility: Added logic to detect if the new
giscedata.signature.provider.accountmodel exists and fall back to legacy behavior if not - Test modernization: Updated tests to mock SDK methods directly rather than internal functions, removed unnecessary mocks, and added Python 3.11.4 support
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| poweremail_signaturit/terp.py | Added dependency on giscedata_signatura_documents_signaturit module |
| .github/workflows/run_tests.yml | Added Python 3.11.4 to the test matrix alongside Python 2.7.18 |
| poweremail_signaturit/poweremail_core.py | Added get_signaturit_client() instance method with multicompany support and backward compatibility logic; updated existing methods to use new instance method |
| poweremail_signaturit/poweremail_mailbox.py | Added get_signaturit_client() instance method that delegates to PoweremailCore; updated update_poweremail_certificate() to use instance method |
| poweremail_signaturit/tests/test_download_audit_trail.py | Updated mock path from global function to instance method (PoweremailCore.get_signaturit_client) |
| poweremail_signaturit/tests/init.py | Removed unnecessary test setup code and mocks; simplified tests to mock SDK methods directly; added test assertions for multicompany client acquisition |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adaptar poweremail_signaturit a refactor y a multicompany