This repository was archived by the owner on Jun 9, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727
2828from u2flib_host .yubicommon .setup import setup
2929
30+ tests_require = ['cryptography>=1.0' ]
31+ if (sys .version_info < (3 , 3 )):
32+ tests_require .append ('mock' )
3033
3134setup (
3235 name = 'python-u2flib-host' ,
4447 'u2f-authenticate=u2flib_host.authenticate:main' ,
4548 ],
4649 },
47- tests_require = [ 'cryptography>=1.0' ] ,
50+ tests_require = tests_require ,
4851 extras_require = {
4952 'soft_device' : ['cryptography>=1.0' ],
5053 },
Original file line number Diff line number Diff line change 33from u2flib_host import hid_transport
44from u2flib_host import exc
55from u2flib_host .yubicommon .compat import byte2int , int2byte
6- from mock import patch
76
8- class TestHIDDevice ():
7+ try :
8+ from unittest .mock import patch
9+ except ImportError :
10+ from mock import patch
11+
12+ class TestHIDDevice (object ):
913 def write (self , payload ):
1014 self .cid = payload [1 :5 ]
1115 self .cmd = payload [5 ] ^ hid_transport .TYPE_INIT
@@ -46,7 +50,7 @@ def test_init(self):
4650 dev .init ()
4751 self .assertEqual (dev .capabilities , 0x05 )
4852
49- def test_init_invalid_nounce (self ):
53+ def test_init_invalid_nonce (self ):
5054 with patch .object (os , 'urandom' , return_value = (b'\xab ' * 8 )) as mock_method :
5155 hid_device = TestHIDDevice ()
5256 hid_device .response = HIDDeviceTest .build_response (
You can’t perform that action at this time.
0 commit comments