mirror of
https://github.com/caronc/apprise.git
synced 2025-08-18 04:20:23 +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
|
||||
@@ -211,7 +204,7 @@ def test_plugin_discord_general(mock_post):
|
||||
footer=True, thumbnail=False)
|
||||
|
||||
# Test that we get a string response
|
||||
assert isinstance(obj.url(), six.string_types) is True
|
||||
assert isinstance(obj.url(), str) is True
|
||||
|
||||
# This call includes an image with it's payload:
|
||||
assert obj.notify(
|
||||
@@ -240,7 +233,7 @@ def test_plugin_discord_general(mock_post):
|
||||
|
||||
desc, results = obj.extract_markdown_sections(test_markdown)
|
||||
# we have a description
|
||||
assert isinstance(desc, six.string_types) is True
|
||||
assert isinstance(desc, str) is True
|
||||
assert desc.startswith('A section of text that has no header at the top.')
|
||||
assert desc.endswith('string.')
|
||||
|
||||
@@ -265,7 +258,7 @@ def test_plugin_discord_general(mock_post):
|
||||
desc, results = obj.extract_markdown_sections(test_markdown)
|
||||
assert isinstance(results, list) is True
|
||||
# No desc details filled out
|
||||
assert isinstance(desc, six.string_types) is True
|
||||
assert isinstance(desc, str) is True
|
||||
assert not desc
|
||||
|
||||
# We should have 5 sections (since there are 5 headers identified above)
|
||||
@@ -325,7 +318,7 @@ def test_plugin_discord_general(mock_post):
|
||||
assert len(results) == 0
|
||||
|
||||
# No desc details filled out
|
||||
assert isinstance(desc, six.string_types) is True
|
||||
assert isinstance(desc, str) is True
|
||||
assert not desc
|
||||
|
||||
# String without Heading
|
||||
@@ -336,7 +329,7 @@ def test_plugin_discord_general(mock_post):
|
||||
assert len(results) == 0
|
||||
|
||||
# No desc details filled out
|
||||
assert isinstance(desc, six.string_types) is True
|
||||
assert isinstance(desc, str) is True
|
||||
assert desc == 'Just a string without any header entries.\n' + \
|
||||
'A second line'
|
||||
|
||||
|
Reference in New Issue
Block a user