Refactor + tests for Apprise custom integration#3057
Conversation
… them directly into the constructor of AppriseAsset Added some basic tests to validate those changes
…sing the http verb
due to a type, the "user" component was inserted twice into the auth tuple
…thentication process chg(apprise): create headers and params dict in place
chore(apprise): more readable schema substitution chore(apprise): renaiming
…ndlers must not raise exception but instead return a boolean based on the outcome of the sending process
…n invoking `process_notification`
|
"and adding several features" I see PATCH and HEAD, what else was changed/added? |
|
And can I ask, why? whats the background here? how did you come to this point? |
| ) | ||
|
|
||
|
|
||
| @pytest.mark.parametrize( |
There was a problem hiding this comment.
Could you explain this to me? how does this work?
There was a problem hiding this comment.
pytest.mark.parametrize allows you to reuse the same test code with different parameters. For example, test_get_headers tests header parsing starting from different URLs, for which the expected result is known.
It's like doing a for loop on a single test, but in a much cleaner and more concise way (standard for pytest).
|
I'm using this custom handler to send callbacks to my other services with the differences detected. So I took a look at the code to better understand how it works. |
|
OK super nice, thanks so much! yes its better to move that code to its own file, PATCH and HEAD are also super handy! |
|
Just one thing
Was there a test for this? and it wasnt caught or? grazie! |
|
I didn't find a specific test for that case, I think there isn't a process_notification test that has, as destination url, an url that includes the authentication parameters. The bug (on master) is in Prego! |
|
If you could kindly add a test for that situation then I think this code is ready to merge :) |
|
Sure, it's already included in Four different scenarios:
If you know any other scenario(s) to test, let me know! |
This PR aims to refactor the Apprise custom integration to improve its readability, maintainability, and code coverage by introducing new tests and adding several features. The changelog follow the Keep a Changelog format.
Added
PATCHandHEADmethodsFixed
ValidateAppRiseServers, Apprise custom handlers are now correctly loadedChanged
apprise_pluginfolder__init__.pyAppriseAssetconstructorrequests.request()instead of dynamically retrieving method aliasesFinally, I've manually tested some custom URLs notification: