ntfy:// markdown support added (#1056)

This commit is contained in:
Chris Caron
2024-02-03 13:26:12 -05:00
committed by GitHub
parent 31a4f2e735
commit e9beea22bc
2 changed files with 21 additions and 0 deletions

View File

@ -487,6 +487,22 @@ def test_plugin_custom_ntfy_edge_cases(mock_post):
assert response['attach'] == 'http://example.com/file.jpg'
assert response['filename'] == 'smoke.jpg'
# Reset our mock object
mock_post.reset_mock()
# Markdown Support
results = NotifyNtfy.parse_url('ntfys://topic/?format=markdown')
assert isinstance(results, dict)
instance = NotifyNtfy(**results)
assert instance.notify(
body='body', title='title',
notify_type=apprise.NotifyType.INFO) is True
assert mock_post.call_count == 1
assert mock_post.call_args_list[0][0][0] == 'https://ntfy.sh'
assert 'X-Markdown' in mock_post.call_args_list[0][1]['headers']
@mock.patch('requests.post')
@mock.patch('requests.get')