diff options
author | Azul <azul@riseup.net> | 2021-02-03 10:49:29 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2021-02-08 14:54:46 +0100 |
commit | 280796ac92d25ada9d6fd79d03aea7676b83ded7 (patch) | |
tree | 3991b0f7abcbf24e6a1f63f51775f6185a745f18 /ffi/lang/python/tests/test_cert.py | |
parent | 65f9d716c56c809b5cca59f964963b5ee062e261 (diff) |
ffi: Move NetworkPolicy into net for python.
- See #665.
- Also add test for keyserver to make sure the fix is correct.
Diffstat (limited to 'ffi/lang/python/tests/test_cert.py')
-rw-r--r-- | ffi/lang/python/tests/test_cert.py | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/ffi/lang/python/tests/test_cert.py b/ffi/lang/python/tests/test_cert.py index 8c38f205..98222529 100644 --- a/ffi/lang/python/tests/test_cert.py +++ b/ffi/lang/python/tests/test_cert.py @@ -1,7 +1,7 @@ from os.path import join from tempfile import TemporaryDirectory -from sequoia.core import Context, NetworkPolicy, Reader, Writer +from sequoia.core import Context, Reader, Writer from sequoia.openpgp import ArmorReader, Fingerprint, Cert, PacketPile pgp = "../../../openpgp/tests/data/keys/testy.pgp" @@ -9,15 +9,13 @@ asc = "../../../openpgp/tests/data/keys/testy.asc" fp = Fingerprint.from_hex("3E8877C877274692975189F5D03F6F865226FE8B") def test_from_reader(): - ctx = Context(network_policy=NetworkPolicy.Offline, - ephemeral=True) + ctx = Context(ephemeral=True) r = Reader.open(ctx, pgp) t = Cert.from_reader(ctx, r) assert t.fingerprint() == fp def test_from_armor_reader(): - ctx = Context(network_policy=NetworkPolicy.Offline, - ephemeral=True) + ctx = Context(ephemeral=True) k = open(asc, "rb").read() r = Reader.from_bytes(ctx, k) r = ArmorReader.new(ctx, r) @@ -25,27 +23,23 @@ def test_from_armor_reader(): assert t.fingerprint() == fp def test_from_file(): - ctx = Context(network_policy=NetworkPolicy.Offline, - ephemeral=True) + ctx = Context(ephemeral=True) t = Cert.open(ctx, pgp) assert t.fingerprint() == fp def test_from_packet_pile(): - ctx = Context(network_policy=NetworkPolicy.Offline, - ephemeral=True) + ctx = Context(ephemeral=True) r = PacketPile.open(ctx, pgp) t = Cert.from_packet_pile(ctx, r) assert t.fingerprint() == fp def test_from_bytes(): - ctx = Context(network_policy=NetworkPolicy.Offline, - ephemeral=True) + ctx = Context(ephemeral=True) t = Cert.from_bytes(ctx, open(pgp, "rb").read()) assert t.fingerprint() == fp def test_from_serialize(): - ctx = Context(network_policy=NetworkPolicy.Offline, - ephemeral=True) + ctx = Context(ephemeral=True) with TemporaryDirectory() as tmp: sink = join(tmp, "a") @@ -57,16 +51,14 @@ def test_from_serialize(): assert t.fingerprint() == fp def test_equals(): - ctx = Context(network_policy=NetworkPolicy.Offline, - ephemeral=True) + ctx = Context(ephemeral=True) b = open(pgp, "rb").read() t = Cert.from_bytes(ctx, b) u = Cert.from_bytes(ctx, b) assert t == u def test_clone(): - ctx = Context(network_policy=NetworkPolicy.Offline, - ephemeral=True) + ctx = Context(ephemeral=True) a = Cert.open(ctx, pgp) b = a.copy() del a |