diff --git a/pyproject.toml b/pyproject.toml index 77a9c5e..e6c07e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,8 +9,8 @@ build-backend = "setuptools.build_meta" [project] name = "pywebpush" -version = "2.1.0" -license = {text = "MPL-2.0"} +version = "2.1.2" +license = { text = "MPL-2.0" } authors = [{ name = "JR Conlin", email = "src+webpusher@jrconlin.com" }] description = "WebPush publication library" readme = "README.md" @@ -20,7 +20,6 @@ classifiers = [ "Programming Language :: Python :: Implementation :: PyPy", "Programming Language :: Python", "Programming Language :: Python :: 3", - "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", ] dynamic = ["dependencies"] @@ -35,7 +34,7 @@ dev = ["black", "mock", "pytest"] pywebpush = "pywebpush.__main__:main" [tool.setuptools.dynamic] -dependencies = {file = "requirements.txt"} +dependencies = { file = "requirements.txt" } [tool.setuptools.packages.find] include = ["pywebpush*"] diff --git a/pywebpush/tests/test_webpush.py b/pywebpush/tests/test_webpush.py index 324c6d4..198dc69 100644 --- a/pywebpush/tests/test_webpush.py +++ b/pywebpush/tests/test_webpush.py @@ -4,18 +4,22 @@ import unittest import time from typing import cast, Union, Dict +from unittest.mock import patch, Mock, AsyncMock import http_ece import py_vapid import requests -from mock import patch, Mock, AsyncMock from cryptography.hazmat.primitives.asymmetric import ec from cryptography.hazmat.primitives import serialization from cryptography.hazmat.backends import default_backend from pywebpush import ( - WebPusher, NoData, WebPushException, CaseInsensitiveDict, webpush, - webpush_async + WebPusher, + NoData, + WebPushException, + CaseInsensitiveDict, + webpush, + webpush_async, ) @@ -28,13 +32,9 @@ class WebpushTestUtils(unittest.TestCase): "M5xqEwuPM7VuQcyiLDhvovthPIXx+gsQRQ==" ) - def _gen_subscription_info( - self, recv_key=None, endpoint="https://example.com/" - ): + def _gen_subscription_info(self, recv_key=None, endpoint="https://example.com/"): if not recv_key: - recv_key = ec.generate_private_key( - ec.SECP256R1(), default_backend() - ) + recv_key = ec.generate_private_key(ec.SECP256R1(), default_backend()) return { "endpoint": endpoint, "keys": { @@ -539,9 +539,7 @@ async def test_webpush_async_bad_vapid_no_key(self): async def test_webpush_async_bad_vapid_bad_return(self, mock_post): mock_post.return_value.status = 410 mock_post.return_value.reason = "Gone" - mock_post.return_value.text = AsyncMock( - return_value="Subscription expired" - ) + mock_post.return_value.text = AsyncMock(return_value="Subscription expired") subscription_info = self._gen_subscription_info() data = "Mary had a little lamb"