1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
import pytest
from jose.jwk import Key
@pytest.fixture
def alg():
return Key("key", "ALG")
class TestBaseAlgorithm:
def test_sign_is_interface(self, alg):
with pytest.raises(NotImplementedError):
alg.sign("msg")
def test_verify_is_interface(self, alg):
with pytest.raises(NotImplementedError):
alg.verify("msg", "sig")
def test_encrypt_is_interface(self, alg):
with pytest.raises(NotImplementedError):
alg.encrypt(
"plain text",
)
def test_decrypt_is_interface(self, alg):
with pytest.raises(NotImplementedError):
alg.decrypt("plain text", iv="iv")
def test_wrap_key_is_interface(self, alg):
with pytest.raises(NotImplementedError):
alg.wrap_key("plain text")
def test_unwrap_key_is_interface(self, alg):
with pytest.raises(NotImplementedError):
alg.unwrap_key("plain text")
|