protocol: add docstrings and replace custom exceptions

This commit is contained in:
Roman Zeyde
2016-02-19 10:48:36 +02:00
parent 566e4310e1
commit 21e89014c9
2 changed files with 28 additions and 19 deletions

View File

@@ -38,7 +38,7 @@ def test_ecdsa_sign():
def test_sign_missing():
h = protocol.Handler(keys=[], signer=ecdsa_signer)
with pytest.raises(protocol.MissingKey):
with pytest.raises(KeyError):
h.handle(NIST256_SIGN_MSG)
@@ -51,7 +51,7 @@ def test_sign_wrong():
key = formats.import_public_key(NIST256_KEY)
h = protocol.Handler(keys=[key], signer=wrong_signature)
with pytest.raises(protocol.BadSignature):
with pytest.raises(ValueError):
h.handle(NIST256_SIGN_MSG)