| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
import logging |
| 30 |
|
| 31 |
from helpers import AppriseURLTester |
| 32 |
import requests |
| 33 |
|
| 34 |
from apprise.plugins.spugpush import NotifySpugpush |
| 35 |
|
| 36 |
logging.disable(logging.CRITICAL) |
| 37 |
|
| 38 |
apprise_url_tests = ( |
| 39 |
( |
| 40 |
"spugpush://", |
| 41 |
{ |
| 42 |
"instance": TypeError, |
| 43 |
}, |
| 44 |
), |
| 45 |
( |
| 46 |
"spugpush://invalid!", |
| 47 |
{ |
| 48 |
"instance": TypeError, |
| 49 |
}, |
| 50 |
), |
| 51 |
( |
| 52 |
"spugpush://abc123def456ghi789jkl012mno345pq", |
| 53 |
{ |
| 54 |
"instance": NotifySpugpush, |
| 55 |
"privacy_url": "spugpush://****/", |
| 56 |
}, |
| 57 |
), |
| 58 |
( |
| 59 |
"spugpush://?token=abc123def456ghi789jkl012mno345pq", |
| 60 |
{ |
| 61 |
"instance": NotifySpugpush, |
| 62 |
"privacy_url": "spugpush://****/", |
| 63 |
}, |
| 64 |
), |
| 65 |
( |
| 66 |
"https://push.spug.dev/send/abc123def456ghi789jkl012mno345pq", |
| 67 |
{ |
| 68 |
"instance": NotifySpugpush, |
| 69 |
}, |
| 70 |
), |
| 71 |
( |
| 72 |
"spugpush://abc123def456ghi789jkl012mno345pq", |
| 73 |
{ |
| 74 |
"instance": NotifySpugpush, |
| 75 |
"response": False, |
| 76 |
"requests_response_code": requests.codes.internal_server_error, |
| 77 |
}, |
| 78 |
), |
| 79 |
( |
| 80 |
"spugpush://abc123def456ghi789jkl012mno345pq", |
| 81 |
{ |
| 82 |
"instance": NotifySpugpush, |
| 83 |
"response": False, |
| 84 |
"requests_response_code": 999, |
| 85 |
}, |
| 86 |
), |
| 87 |
( |
| 88 |
"spugpush://ffffffffffffffffffffffffffffffff", |
| 89 |
{ |
| 90 |
"instance": NotifySpugpush, |
| 91 |
"test_requests_exceptions": True, |
| 92 |
}, |
| 93 |
), |
| 94 |
) |
| 95 |
|
| 96 |
|
| 97 |
def test_plugin_spugpush_urls(): |
| 98 |
AppriseURLTester(tests=apprise_url_tests).run_all() |