mirror of
https://github.com/caronc/apprise-api.git
synced 2025-08-19 10:51:27 +02:00
Custom plugin directory scanning support added (#111)
This commit is contained in:
@@ -54,6 +54,9 @@ class StatelessNotifyTests(SimpleTestCase):
|
||||
form = NotifyByUrlForm(data=form_data)
|
||||
assert form.is_valid()
|
||||
|
||||
# Required to prevent None from being passed into self.client.post()
|
||||
del form.cleaned_data['attachment']
|
||||
|
||||
response = self.client.post('/notify', form.cleaned_data)
|
||||
assert response.status_code == 200
|
||||
assert mock_notify.call_count == 1
|
||||
@@ -68,6 +71,9 @@ class StatelessNotifyTests(SimpleTestCase):
|
||||
form = NotifyByUrlForm(data=form_data)
|
||||
assert form.is_valid()
|
||||
|
||||
# Required to prevent None from being passed into self.client.post()
|
||||
del form.cleaned_data['attachment']
|
||||
|
||||
response = self.client.post('/notify', form.cleaned_data)
|
||||
assert response.status_code == 200
|
||||
assert mock_notify.call_count == 1
|
||||
@@ -109,6 +115,9 @@ class StatelessNotifyTests(SimpleTestCase):
|
||||
form = NotifyByUrlForm(data=form_data)
|
||||
assert form.is_valid()
|
||||
|
||||
# Required to prevent None from being passed into self.client.post()
|
||||
del form.cleaned_data['attachment']
|
||||
|
||||
response = self.client.post('/notify', form.cleaned_data)
|
||||
assert response.status_code == 424
|
||||
assert mock_notify.call_count == 2
|
||||
@@ -139,6 +148,9 @@ class StatelessNotifyTests(SimpleTestCase):
|
||||
form = NotifyByUrlForm(data=form_data)
|
||||
assert form.is_valid()
|
||||
|
||||
# Required to prevent None from being passed into self.client.post()
|
||||
del form.cleaned_data['attachment']
|
||||
|
||||
# recursion value is within correct limits
|
||||
response = self.client.post('/notify', form.cleaned_data, **headers)
|
||||
assert response.status_code == 200
|
||||
@@ -221,6 +233,9 @@ class StatelessNotifyTests(SimpleTestCase):
|
||||
form = NotifyByUrlForm(data=form_data)
|
||||
assert form.is_valid()
|
||||
|
||||
# Required to prevent None from being passed into self.client.post()
|
||||
del form.cleaned_data['attachment']
|
||||
|
||||
# This still works as the environment variable kicks in
|
||||
response = self.client.post('/notify', form.cleaned_data)
|
||||
assert response.status_code == 200
|
||||
@@ -340,7 +355,7 @@ class StatelessNotifyTests(SimpleTestCase):
|
||||
assert response.status_code == 400
|
||||
assert mock_notify.call_count == 0
|
||||
|
||||
@patch('apprise.plugins.NotifyJSON.send')
|
||||
@patch('apprise.plugins.NotifyJSON.NotifyJSON.send')
|
||||
def test_notify_with_filters(self, mock_send):
|
||||
"""
|
||||
Test workings of APPRISE_DENY_SERVICES and APPRISE_ALLOW_SERVICES
|
||||
|
Reference in New Issue
Block a user