def test_algorithm_should_throw_exception_if_verify_not_impl(self): algo = Algorithm() with pytest.raises(NotImplementedError): algo.verify('message', 'key', 'signature')
def test_register_algo_does_not_allow_duplicate_registration(self, jws): jws.register_algorithm("AAA", Algorithm()) with pytest.raises(ValueError): jws.register_algorithm("AAA", Algorithm())
def test_algorithm_should_throw_exception_if_prepare_key_not_impl(self): algo = Algorithm() with pytest.raises(NotImplementedError): algo.prepare_key('test')
def test_algorithm_should_throw_exception_if_sign_not_impl(self): algo = Algorithm() with pytest.raises(NotImplementedError): algo.sign('message', 'key')
def test_algorithm_should_throw_exception_if_verify_not_impl(self): algo = Algorithm() with self.assertRaises(NotImplementedError): algo.verify('message', 'key', 'signature')
def test_algorithm_should_throw_exception_if_sign_not_impl(self): algo = Algorithm() with self.assertRaises(NotImplementedError): algo.sign('message', 'key')
def test_algorithm_should_throw_exception_if_prepare_key_not_impl(self): algo = Algorithm() with self.assertRaises(NotImplementedError): algo.prepare_key('test')
def test_algorithm_should_throw_exception_if_from_jwk_not_impl(self): algo = Algorithm() with pytest.raises(NotImplementedError): algo.to_jwk("value")
def test_register_algorithm_does_not_allow_duplicate_registration(self, jwt): jwt.register_algorithm('AAA', Algorithm()) with pytest.raises(ValueError): jwt.register_algorithm('AAA', Algorithm())