RHEL9 Support - Test cases to leverage unittest.mock when possible (#658)

This commit is contained in:
Chris Caron 2022-08-31 20:05:40 -04:00 committed by GitHub
parent 782f2e602b
commit 2d5ab59252
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
69 changed files with 557 additions and 69 deletions

View File

@ -1,6 +1,6 @@
coverage coverage
flake8 flake8
mock mock; python_version=='2.7'
pytest pytest
pytest-cov pytest-cov
tox tox

View File

@ -60,7 +60,7 @@ Techulus Push, Telegram, Twilio, Twitter, Twist, XBMC, Vonage, Webex Teams}
Name: python-%{pypi_name} Name: python-%{pypi_name}
Version: 1.0.0 Version: 1.0.0
Release: 1%{?dist} Release: 2%{?dist}
Summary: A simple wrapper to many popular notification services used today Summary: A simple wrapper to many popular notification services used today
License: MIT License: MIT
URL: https://github.com/caronc/%{pypi_name} URL: https://github.com/caronc/%{pypi_name}
@ -161,7 +161,12 @@ Requires: python%{python3_pkgversion}-cryptography
Requires: python%{python3_pkgversion}-yaml Requires: python%{python3_pkgversion}-yaml
%if %{with tests} %if %{with tests}
%if 0%{?rhel} >= 9
# Do not import python3-mock
%else
# python-mock switched to unittest.mock
BuildRequires: python%{python3_pkgversion}-mock BuildRequires: python%{python3_pkgversion}-mock
%endif
BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-pytest-runner BuildRequires: python%{python3_pkgversion}-pytest-runner
%endif %endif
@ -183,6 +188,17 @@ rm -f apprise/py3compat/asyncio.py
%patch1 -p1 %patch1 -p1
%endif %endif
%if 0%{?rhel} >= 9
# Nothing to do under normal circumstances; this line here allows legacy
# copies of Apprise to still build against this one
find test -type f -name '*.py' -exec \
sed -i -e 's|^import mock|from unittest import mock|g' {} \;
%else
# support python-mock (remain backwards compatible with older distributions)
find test -type f -name '*.py' -exec \
sed -i -e 's|^from unittest import mock|import mock|g' {} \;
%endif
%build %build
%if 0%{?with_python2} %if 0%{?with_python2}
%py2_build %py2_build
@ -243,6 +259,9 @@ LANG=C.UTF-8 PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version
%endif %endif
%changelog %changelog
* Wed Aug 31 2022 Chris Caron <lead2gold@gmail.com> - 1.0.0-2
- Rebuilt for RHEL9 Support
* Sat Aug 6 2022 Chris Caron <lead2gold@gmail.com> - 1.0.0-1 * Sat Aug 6 2022 Chris Caron <lead2gold@gmail.com> - 1.0.0-1
- Updated to v1.0.0 - Updated to v1.0.0

View File

@ -26,7 +26,14 @@ import re
import os import os
import six import six
import requests import requests
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
from json import dumps from json import dumps
from random import choice from random import choice
from string import ascii_uppercase as str_alpha from string import ascii_uppercase as str_alpha

View File

@ -29,7 +29,14 @@ import sys
import six import six
import pytest import pytest
import requests import requests
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
from os.path import dirname from os.path import dirname
from os.path import join from os.path import join

View File

@ -26,7 +26,14 @@
import sys import sys
import six import six
import io import io
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
from apprise import NotifyFormat from apprise import NotifyFormat
from apprise import ConfigFormat from apprise import ConfigFormat

View File

@ -23,7 +23,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
from apprise.attachment.AttachBase import AttachBase from apprise.attachment.AttachBase import AttachBase

View File

@ -25,7 +25,14 @@
import re import re
import time import time
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
from os.path import dirname from os.path import dirname
from os.path import join from os.path import join
from apprise.attachment.AttachBase import AttachBase from apprise.attachment.AttachBase import AttachBase

View File

@ -25,7 +25,14 @@
import re import re
import six import six
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
import mimetypes import mimetypes
from os.path import join from os.path import join

View File

@ -24,7 +24,14 @@
# THE SOFTWARE. # THE SOFTWARE.
from __future__ import print_function from __future__ import print_function
import re import re
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
import json import json
from inspect import cleandoc from inspect import cleandoc

View File

@ -24,7 +24,14 @@
# THE SOFTWARE. # THE SOFTWARE.
import six import six
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
from apprise.config.ConfigFile import ConfigFile from apprise.config.ConfigFile import ConfigFile
from apprise.plugins.NotifyBase import NotifyBase from apprise.plugins.NotifyBase import NotifyBase
from apprise.AppriseAsset import AppriseAsset from apprise.AppriseAsset import AppriseAsset

View File

@ -26,7 +26,14 @@
import six import six
import time import time
import pytest import pytest
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from apprise.common import ConfigFormat from apprise.common import ConfigFormat
from apprise.config.ConfigHTTP import ConfigHTTP from apprise.config.ConfigHTTP import ConfigHTTP

View File

@ -25,7 +25,14 @@
import os import os
import sys import sys
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from apprise import plugins from apprise import plugins
from apprise import Apprise from apprise import Apprise

View File

@ -27,7 +27,14 @@ import sys
from json import loads from json import loads
import pytest import pytest
import requests import requests
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import apprise import apprise

View File

@ -24,7 +24,14 @@
# THE SOFTWARE. # THE SOFTWARE.
import os import os
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import ctypes import ctypes
from apprise import AppriseLocale from apprise import AppriseLocale

View File

@ -26,7 +26,14 @@
import re import re
import os import os
import sys import sys
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from apprise import Apprise from apprise import Apprise

View File

@ -23,7 +23,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import pytest import pytest
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
from helpers import AppriseURLTester from helpers import AppriseURLTester
from apprise import plugins from apprise import plugins
from apprise import NotifyType from apprise import NotifyType

View File

@ -24,7 +24,14 @@
# THE SOFTWARE. # THE SOFTWARE.
import os import os
import sys import sys
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from apprise import plugins from apprise import plugins
from helpers import AppriseURLTester from helpers import AppriseURLTester

View File

@ -23,7 +23,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import json import json
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from apprise import plugins from apprise import plugins
from helpers import AppriseURLTester from helpers import AppriseURLTester

View File

@ -25,7 +25,14 @@
import os import os
import sys import sys
import re import re
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from apprise import plugins from apprise import plugins
from apprise import Apprise from apprise import Apprise

View File

@ -25,7 +25,14 @@
# Disable logging for a cleaner testing output # Disable logging for a cleaner testing output
import logging import logging
import requests import requests
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import apprise import apprise
from apprise.plugins.NotifyDapnet import DapnetPriority from apprise.plugins.NotifyDapnet import DapnetPriority

View File

@ -25,7 +25,14 @@
import os import os
import six import six
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from helpers import AppriseURLTester from helpers import AppriseURLTester

View File

@ -26,7 +26,14 @@
import os import os
import re import re
import six import six
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import smtplib import smtplib
from email.header import decode_header from email.header import decode_header

View File

@ -22,7 +22,14 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
from json import dumps from json import dumps
from apprise import Apprise from apprise import Apprise
from apprise import plugins from apprise import plugins

View File

@ -33,7 +33,14 @@ import io
import os import os
import six import six
import sys import sys
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
import json import json

View File

@ -22,7 +22,14 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from apprise import plugins from apprise import plugins

View File

@ -25,7 +25,14 @@
import six import six
import pytest import pytest
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from helpers import AppriseURLTester from helpers import AppriseURLTester
from apprise import plugins from apprise import plugins

View File

@ -26,7 +26,14 @@
import re import re
import six import six
import pytest import pytest
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import sys import sys
import types import types
import apprise import apprise

View File

@ -24,7 +24,14 @@
# THE SOFTWARE. # THE SOFTWARE.
import six import six
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import sys import sys
import types import types
import pytest import pytest

View File

@ -22,7 +22,14 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
import apprise import apprise

View File

@ -24,7 +24,14 @@
# THE SOFTWARE. # THE SOFTWARE.
import sys import sys
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import six import six
import pytest import pytest
import apprise import apprise

View File

@ -25,7 +25,14 @@
import os import os
import six import six
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from helpers import AppriseURLTester from helpers import AppriseURLTester

View File

@ -24,7 +24,14 @@
# THE SOFTWARE. # THE SOFTWARE.
import six import six
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from apprise import plugins from apprise import plugins
from apprise import Apprise from apprise import Apprise

View File

@ -23,7 +23,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import pytest import pytest
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from apprise import plugins from apprise import plugins
from apprise import NotifyType from apprise import NotifyType

View File

@ -22,7 +22,14 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
import apprise import apprise

View File

@ -25,7 +25,14 @@
import os import os
import six import six
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
from helpers import module_reload from helpers import module_reload
import apprise import apprise

View File

@ -25,7 +25,14 @@
import os import os
import sys import sys
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from helpers import AppriseURLTester from helpers import AppriseURLTester
from apprise import plugins from apprise import plugins

View File

@ -24,7 +24,14 @@
# THE SOFTWARE. # THE SOFTWARE.
import six import six
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
import pytest import pytest
from apprise import plugins from apprise import plugins

View File

@ -22,7 +22,14 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from apprise import plugins from apprise import plugins

View File

@ -23,7 +23,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import re import re
import sys import sys
import ssl import ssl

View File

@ -22,7 +22,14 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from apprise import plugins from apprise import plugins

View File

@ -23,7 +23,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import json import json
import requests import requests
import pytest import pytest

View File

@ -24,7 +24,14 @@
# THE SOFTWARE. # THE SOFTWARE.
import six import six
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from apprise import plugins from apprise import plugins
from helpers import AppriseURLTester from helpers import AppriseURLTester

View File

@ -24,7 +24,14 @@
# THE SOFTWARE. # THE SOFTWARE.
import six import six
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from apprise import plugins from apprise import plugins
from helpers import AppriseURLTester from helpers import AppriseURLTester

View File

@ -24,7 +24,14 @@
# THE SOFTWARE. # THE SOFTWARE.
import os import os
import json import json
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from apprise import plugins from apprise import plugins
import apprise import apprise

View File

@ -25,7 +25,14 @@
import os import os
import six import six
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from datetime import datetime from datetime import datetime

View File

@ -22,7 +22,14 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from apprise.plugins.NotifyOpsgenie import OpsgeniePriority from apprise.plugins.NotifyOpsgenie import OpsgeniePriority
import apprise import apprise

View File

@ -22,7 +22,14 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from apprise.plugins.NotifyProwl import ProwlPriority from apprise.plugins.NotifyProwl import ProwlPriority

View File

@ -24,7 +24,14 @@
# THE SOFTWARE. # THE SOFTWARE.
import os import os
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from json import dumps from json import dumps

View File

@ -22,7 +22,14 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from apprise import plugins from apprise import plugins

View File

@ -24,7 +24,14 @@
# THE SOFTWARE. # THE SOFTWARE.
import os import os
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
import pytest import pytest
from json import dumps from json import dumps

View File

@ -25,7 +25,14 @@
import os import os
import pytest import pytest
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from json import dumps from json import dumps
from apprise import AppriseAttachment from apprise import AppriseAttachment

View File

@ -25,7 +25,14 @@
import six import six
import requests import requests
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
from apprise import plugins from apprise import plugins
from helpers import AppriseURLTester from helpers import AppriseURLTester

View File

@ -22,7 +22,14 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from apprise import plugins from apprise import plugins

View File

@ -22,7 +22,14 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from apprise import plugins from apprise import plugins

View File

@ -24,7 +24,14 @@
# THE SOFTWARE. # THE SOFTWARE.
import os import os
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from apprise import Apprise from apprise import Apprise

View File

@ -25,7 +25,14 @@
import os import os
import sys import sys
from json import loads from json import loads
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from apprise import plugins from apprise import plugins

View File

@ -23,7 +23,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import sys import sys
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
import json import json

View File

@ -22,7 +22,14 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from json import dumps from json import dumps

View File

@ -25,7 +25,14 @@
import os import os
import six import six
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from apprise import plugins from apprise import plugins

View File

@ -25,7 +25,14 @@
import os import os
import sys import sys
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from apprise import plugins from apprise import plugins
from apprise import Apprise from apprise import Apprise

View File

@ -23,7 +23,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from apprise import plugins from apprise import plugins

View File

@ -25,7 +25,14 @@
import os import os
import pytest import pytest
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from json import dumps from json import dumps
from apprise import plugins from apprise import plugins

View File

@ -25,7 +25,14 @@
import re import re
import pytest import pytest
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import apprise import apprise
import socket import socket

View File

@ -27,7 +27,14 @@ import os
import six import six
import sys import sys
import pytest import pytest
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from json import dumps from json import dumps
from json import loads from json import loads

View File

@ -24,7 +24,14 @@
# THE SOFTWARE. # THE SOFTWARE.
import six import six
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
import pytest import pytest
from json import dumps from json import dumps

View File

@ -23,7 +23,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import requests import requests
from json import dumps from json import dumps
from apprise import plugins from apprise import plugins

View File

@ -25,7 +25,14 @@
import os import os
import six import six
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from json import dumps from json import dumps

View File

@ -22,7 +22,14 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import pytest import pytest
import requests import requests
from json import dumps from json import dumps

View File

@ -24,7 +24,14 @@
# THE SOFTWARE. # THE SOFTWARE.
import pytest import pytest
import mock try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
import sys import sys
import six import six
import types import types