Beispiel #1
0
    def test_algorithm_should_throw_exception_if_verify_not_impl(self):
        algo = Algorithm()

        with pytest.raises(NotImplementedError):
            algo.verify('message', 'key', 'signature')
Beispiel #2
0
    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())
Beispiel #3
0
    def test_algorithm_should_throw_exception_if_prepare_key_not_impl(self):
        algo = Algorithm()

        with pytest.raises(NotImplementedError):
            algo.prepare_key('test')
Beispiel #4
0
    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')
Beispiel #8
0
    def test_algorithm_should_throw_exception_if_from_jwk_not_impl(self):
        algo = Algorithm()

        with pytest.raises(NotImplementedError):
            algo.to_jwk("value")
Beispiel #9
0
    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())