fix Py3k issues

This commit is contained in:
Roman Zeyde
2015-07-21 14:38:40 +03:00
parent b6d0efef9f
commit e7585170ae
2 changed files with 14 additions and 12 deletions

View File

@@ -5,12 +5,12 @@ from .. import formats
def test_fingerprint():
fp = '5d:41:40:2a:bc:4b:2a:76:b9:71:9d:91:10:17:c5:92'
assert formats.fingerprint('hello') == fp
assert formats.fingerprint(b'hello') == fp
_point = (
44423495295951059636974944244307637263954375053872017334547086177777411863925L, # nopep8
111713194882028655451852320740440245619792555065469028846314891587105736340201L # nopep8
44423495295951059636974944244307637263954375053872017334547086177777411863925, # nopep8
111713194882028655451852320740440245619792555065469028846314891587105736340201 # nopep8
)
_public_key = (
@@ -24,12 +24,12 @@ _public_key = (
def test_parse_public_key():
key = formats.import_public_key(_public_key)
assert key['name'] == 'home'
assert key['name'] == b'home'
assert key['point'] == _point
assert key['curve'] == 'nistp256'
assert key['curve'] == b'nistp256'
assert key['fingerprint'] == '4b:19:bc:0f:c8:7e:dc:fa:1a:e3:c2:ff:6f:e0:80:a2' # nopep8
assert key['type'] == 'ecdsa-sha2-nistp256'
assert key['type'] == b'ecdsa-sha2-nistp256'
assert key['size'] == 32