Use unittest.mock instead of mock.

This commit is contained in:
Dain Nilsson 2022-04-25 12:32:40 +02:00
parent 69ad253dc9
commit 221b822b12
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
5 changed files with 6 additions and 7 deletions

View File

@ -38,7 +38,6 @@ pcsc = ["pyscard"]
[tool.poetry.dev-dependencies]
pytest = "^6.0"
mock = "^4.0.3"
[build-system]
requires = ["poetry-core>=1.0.0"]

View File

@ -27,9 +27,9 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
import mock
import unittest
import json
from unittest import mock
from threading import Event, Timer
from fido2 import cbor
from fido2.utils import sha256, websafe_decode

View File

@ -25,9 +25,9 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from fido2.ctap1 import Ctap1, ApduError
import unittest
import mock
from unittest import mock
from fido2.ctap1 import Ctap1, ApduError
class TestCtap1(unittest.TestCase):

View File

@ -25,6 +25,8 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
import unittest
from unittest import mock
from fido2.ctap1 import RegistrationData
from fido2.ctap2 import (
Ctap2,
@ -40,8 +42,6 @@ from fido2 import cbor
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import ec
import unittest
import mock
_AAGUID = bytes.fromhex("F8A011F38C0A4D15800617111F9EDC7D")
_INFO = bytes.fromhex(

View File

@ -26,8 +26,8 @@
# POSSIBILITY OF SUCH DAMAGE.
import unittest
import mock
import sys
from unittest import mock
from fido2.hid import CTAPHID
sys.modules["smartcard"] = mock.Mock()