mirror of
https://github.com/caronc/apprise.git
synced 2025-08-14 02:18:37 +02:00
Added support for recent CPython and PyPy versions; Droped Python v2.7 Support (#680)
This commit is contained in:
@ -24,14 +24,7 @@
|
||||
# THE SOFTWARE.
|
||||
|
||||
import os
|
||||
import six
|
||||
try:
|
||||
# Python 3.x
|
||||
from unittest import mock
|
||||
|
||||
except ImportError:
|
||||
# Python 2.7
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
import requests
|
||||
@ -305,7 +298,7 @@ def test_plugin_slack_oauth_access_token(mock_post):
|
||||
# Variation Initializations
|
||||
obj = plugins.NotifySlack(access_token=token, targets='#apprise')
|
||||
assert isinstance(obj, plugins.NotifySlack) is True
|
||||
assert isinstance(obj.url(), six.string_types) is True
|
||||
assert isinstance(obj.url(), str) is True
|
||||
|
||||
# apprise room was found
|
||||
assert obj.send(body="test") is True
|
||||
@ -468,7 +461,7 @@ def test_plugin_slack_send_by_email(mock_get, mock_post):
|
||||
# Variation Initializations
|
||||
obj = plugins.NotifySlack(access_token=token, targets='user@gmail.com')
|
||||
assert isinstance(obj, plugins.NotifySlack) is True
|
||||
assert isinstance(obj.url(), six.string_types) is True
|
||||
assert isinstance(obj.url(), str) is True
|
||||
|
||||
# No calls made yet
|
||||
assert mock_post.call_count == 0
|
||||
@ -524,7 +517,7 @@ def test_plugin_slack_send_by_email(mock_get, mock_post):
|
||||
# Variation Initializations
|
||||
obj = plugins.NotifySlack(access_token=token, targets='user@gmail.com')
|
||||
assert isinstance(obj, plugins.NotifySlack) is True
|
||||
assert isinstance(obj.url(), six.string_types) is True
|
||||
assert isinstance(obj.url(), str) is True
|
||||
|
||||
# No calls made yet
|
||||
assert mock_post.call_count == 0
|
||||
@ -558,7 +551,7 @@ def test_plugin_slack_send_by_email(mock_get, mock_post):
|
||||
# Variation Initializations
|
||||
obj = plugins.NotifySlack(access_token=token, targets='user@gmail.com')
|
||||
assert isinstance(obj, plugins.NotifySlack) is True
|
||||
assert isinstance(obj.url(), six.string_types) is True
|
||||
assert isinstance(obj.url(), str) is True
|
||||
|
||||
# No calls made yet
|
||||
assert mock_post.call_count == 0
|
||||
@ -592,7 +585,7 @@ def test_plugin_slack_send_by_email(mock_get, mock_post):
|
||||
# Variation Initializations
|
||||
obj = plugins.NotifySlack(access_token=token, targets='user@gmail.com')
|
||||
assert isinstance(obj, plugins.NotifySlack) is True
|
||||
assert isinstance(obj.url(), six.string_types) is True
|
||||
assert isinstance(obj.url(), str) is True
|
||||
|
||||
# No calls made yet
|
||||
assert mock_post.call_count == 0
|
||||
@ -636,7 +629,7 @@ def test_plugin_slack_send_by_email(mock_get, mock_post):
|
||||
# Variation Initializations
|
||||
obj = plugins.NotifySlack(access_token=token, targets='user@gmail.com')
|
||||
assert isinstance(obj, plugins.NotifySlack) is True
|
||||
assert isinstance(obj.url(), six.string_types) is True
|
||||
assert isinstance(obj.url(), str) is True
|
||||
|
||||
# No calls made yet
|
||||
assert mock_post.call_count == 0
|
||||
|
Reference in New Issue
Block a user