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:
@ -23,13 +23,7 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
try:
|
||||
# Python 3.x
|
||||
from unittest import mock
|
||||
|
||||
except ImportError:
|
||||
# Python 2.7
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import requests
|
||||
from json import dumps
|
||||
@ -271,21 +265,6 @@ def test_plugin_twist_auth(mock_post, mock_get):
|
||||
# Calling logout on an object already logged out
|
||||
obj.logout()
|
||||
|
||||
# Force a token (to imply we've logged in)
|
||||
obj.token = 'abc'
|
||||
|
||||
mock_post.return_value.status_code = requests.codes.ok
|
||||
mock_get.return_value.status_code = requests.codes.ok
|
||||
|
||||
# Test Python v3.5 LookupError Bug: https://bugs.python.org/issue29288
|
||||
mock_post.side_effect = LookupError()
|
||||
mock_get.side_effect = LookupError()
|
||||
obj.access_token = 'abc'
|
||||
obj.user_id = '123'
|
||||
|
||||
# Tidy object
|
||||
del obj
|
||||
|
||||
|
||||
@mock.patch('requests.get')
|
||||
@mock.patch('requests.post')
|
||||
|
Reference in New Issue
Block a user