File: test_base.py

package info (click to toggle)
python-jose 3.3.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 528 kB
  • sloc: python: 4,020; makefile: 162; sh: 6
file content (36 lines) | stat: -rw-r--r-- 961 bytes parent folder | download
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")