Custom plugin directory scanning support added (#111)

This commit is contained in:
Chris Caron
2023-05-15 18:27:42 -04:00
committed by GitHub
parent 86c9f16d69
commit 4418d8caf0
6 changed files with 70 additions and 26 deletions

View File

@@ -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