Skip to content

Commit

Permalink
testing without secure setting
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc committed Jul 2, 2024
1 parent 691d56f commit 254bbc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions apprise/plugins/wxpusher.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ class NotifyWxPusher(NotifyBase):
service_url = 'https://wxpusher.zjiecode.com/'

# The default protocol
secure_protocol = 'wxpusher'
protocol = 'wxpusher'

# A URL that takes you to the setup/help of the specific protocol
setup_url = 'https://github.com/caronc/apprise/wiki/Notify_wxpusher'

# WxPusher notification endpoint
notify_url = 'https://wxpusher.zjiecode.com/api/send/message'
notify_url = 'http://wxpusher.zjiecode.com/api/send/message'

# Define object templates
templates = (
Expand Down Expand Up @@ -292,7 +292,7 @@ def url(self, privacy=False, *args, **kwargs):
params = self.url_parameters(privacy=privacy, *args, **kwargs)

return '{schema}://{token}/{targets}/?{params}'.format(
schema=self.secure_protocol,
schema=self.protocol,
token=self.pprint(
self.token, privacy, mode=PrivacyMode.Secret, safe=''),
targets='/'.join(chain(
Expand Down
9 changes: 3 additions & 6 deletions test/test_plugin_wxpusher.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def test_plugin_wxpusher_edge_cases(mock_post):
assert mock_post.call_count == 1

details = mock_post.call_args_list[0]
assert details[0][0] == 'https://wxpusher.zjiecode.com/api/send/message'
assert details[0][0] == 'http://wxpusher.zjiecode.com/api/send/message'
payload = loads(details[1]['data'])
assert payload == {
'appToken': 'AT_appid',
Expand All @@ -245,7 +245,6 @@ def test_plugin_wxpusher_edge_cases(mock_post):
'topicIds': [],
'uids': ['UID_abcd'],
'verifyPay': False,
'verifyPayType': 0,
'url': None,
}

Expand Down Expand Up @@ -282,7 +281,7 @@ def test_plugin_wxpusher_result_set(mock_post):
assert mock_post.call_count == 1

details = mock_post.call_args_list[0]
assert details[0][0] == 'https://wxpusher.zjiecode.com/api/send/message'
assert details[0][0] == 'http://wxpusher.zjiecode.com/api/send/message'
payload = loads(details[1]['data'])
assert payload == {
'appToken': 'AT_appid',
Expand All @@ -292,7 +291,6 @@ def test_plugin_wxpusher_result_set(mock_post):
'topicIds': [123],
'uids': ['UID_456'],
'verifyPay': False,
'verifyPayType': 0,
'url': None,
}

Expand All @@ -313,7 +311,7 @@ def test_plugin_wxpusher_result_set(mock_post):
assert mock_post.call_count == 1

details = mock_post.call_args_list[0]
assert details[0][0] == 'https://wxpusher.zjiecode.com/api/send/message'
assert details[0][0] == 'http://wxpusher.zjiecode.com/api/send/message'
payload = loads(details[1]['data'])

assert payload == {
Expand All @@ -324,7 +322,6 @@ def test_plugin_wxpusher_result_set(mock_post):
'topicIds': [123456789],
'uids': ['UID_123', 'UID_abc'],
'verifyPay': False,
'verifyPayType': 0,
'url': None,
}

Expand Down

0 comments on commit 254bbc5

Please sign in to comment.