diff options
Diffstat (limited to 'ffi/lang/python/tests')
-rw-r--r-- | ffi/lang/python/tests/test_armor.py | 3 | ||||
-rw-r--r-- | ffi/lang/python/tests/test_packet_parser.py | 3 | ||||
-rw-r--r-- | ffi/lang/python/tests/test_store.py | 16 | ||||
-rw-r--r-- | ffi/lang/python/tests/test_tpk.py | 24 |
4 files changed, 18 insertions, 28 deletions
diff --git a/ffi/lang/python/tests/test_armor.py b/ffi/lang/python/tests/test_armor.py index e439f612..93486703 100644 --- a/ffi/lang/python/tests/test_armor.py +++ b/ffi/lang/python/tests/test_armor.py @@ -7,8 +7,7 @@ from sequoia.openpgp import ArmorReader, ArmorWriter, Kind TEST_VECTORS = [0, 1, 2, 3, 47, 48, 49, 50, 51] -ctx = Context("org.sequoia-pgp.tests", - network_policy=NetworkPolicy.Offline, +ctx = Context(network_policy=NetworkPolicy.Offline, ephemeral=True) def fn_bin(t): diff --git a/ffi/lang/python/tests/test_packet_parser.py b/ffi/lang/python/tests/test_packet_parser.py index de126bc3..e50a58f5 100644 --- a/ffi/lang/python/tests/test_packet_parser.py +++ b/ffi/lang/python/tests/test_packet_parser.py @@ -6,8 +6,7 @@ pgp = "../../../openpgp/tests/data/messages/encrypted-aes128-password-123456789. plain = "../../../openpgp/tests/data/messages/a-cypherpunks-manifesto.txt" def test_decryption(): - ctx = Context("org.sequoia-pgp.tests", - network_policy=NetworkPolicy.Offline, + ctx = Context(network_policy=NetworkPolicy.Offline, ephemeral=True) class State(Enum): diff --git a/ffi/lang/python/tests/test_store.py b/ffi/lang/python/tests/test_store.py index 0c86a689..454afb7d 100644 --- a/ffi/lang/python/tests/test_store.py +++ b/ffi/lang/python/tests/test_store.py @@ -1,18 +1,18 @@ from sequoia.prelude import Context, Store, Fingerprint def test_open(): - c = Context("org.sequoia-pgp.tests", ephemeral=True) - Store.open(c, "default") + c = Context(ephemeral=True) + Store.open(c) def test_add(): - c = Context("org.sequoia-pgp.tests", ephemeral=True) - s = Store.open(c, "default") + c = Context(ephemeral=True) + s = Store.open(c) fp = Fingerprint.from_hex("7DCA58B54EB143169DDEE15F247F6DABC84914FE") s.add("Ἀριστοτέλης", fp) def test_iterate(): - c = Context("org.sequoia-pgp.tests", ephemeral=True) - s = Store.open(c, "default") + c = Context(ephemeral=True) + s = Store.open(c) fp = Fingerprint.from_hex("7DCA58B54EB143169DDEE15F247F6DABC84914FE") s.add("Ἀριστοτέλης", fp) l = list(s.iter()) @@ -23,8 +23,8 @@ def test_iterate(): assert fpi == fp def test_logs(): - c = Context("org.sequoia-pgp.tests", ephemeral=True) - s = Store.open(c, "default") + c = Context(ephemeral=True) + s = Store.open(c) fp = Fingerprint.from_hex("7DCA58B54EB143169DDEE15F247F6DABC84914FE") b = s.add("Ἀριστοτέλης", fp) l = list(s.iter()) diff --git a/ffi/lang/python/tests/test_tpk.py b/ffi/lang/python/tests/test_tpk.py index c630798f..5e06bd93 100644 --- a/ffi/lang/python/tests/test_tpk.py +++ b/ffi/lang/python/tests/test_tpk.py @@ -9,16 +9,14 @@ asc = "../../../openpgp/tests/data/keys/testy.asc" fp = Fingerprint.from_hex("3E8877C877274692975189F5D03F6F865226FE8B") def test_from_reader(): - ctx = Context("org.sequoia-pgp.tests", - network_policy=NetworkPolicy.Offline, + ctx = Context(network_policy=NetworkPolicy.Offline, ephemeral=True) r = Reader.open(ctx, pgp) t = TPK.from_reader(ctx, r) assert t.fingerprint() == fp def test_from_armor_reader(): - ctx = Context("org.sequoia-pgp.tests", - network_policy=NetworkPolicy.Offline, + ctx = Context(network_policy=NetworkPolicy.Offline, ephemeral=True) k = open(asc, "rb").read() r = Reader.from_bytes(ctx, k) @@ -27,30 +25,26 @@ def test_from_armor_reader(): assert t.fingerprint() == fp def test_from_file(): - ctx = Context("org.sequoia-pgp.tests", - network_policy=NetworkPolicy.Offline, + ctx = Context(network_policy=NetworkPolicy.Offline, ephemeral=True) t = TPK.open(ctx, pgp) assert t.fingerprint() == fp def test_from_packet_pile(): - ctx = Context("org.sequoia-pgp.tests", - network_policy=NetworkPolicy.Offline, + ctx = Context(network_policy=NetworkPolicy.Offline, ephemeral=True) r = PacketPile.open(ctx, pgp) t = TPK.from_packet_pile(ctx, r) assert t.fingerprint() == fp def test_from_bytes(): - ctx = Context("org.sequoia-pgp.tests", - network_policy=NetworkPolicy.Offline, + ctx = Context(network_policy=NetworkPolicy.Offline, ephemeral=True) t = TPK.from_bytes(ctx, open(pgp, "rb").read()) assert t.fingerprint() == fp def test_from_serialize(): - ctx = Context("org.sequoia-pgp.tests", - network_policy=NetworkPolicy.Offline, + ctx = Context(network_policy=NetworkPolicy.Offline, ephemeral=True) with TemporaryDirectory() as tmp: sink = join(tmp, "a") @@ -63,8 +57,7 @@ def test_from_serialize(): assert t.fingerprint() == fp def test_equals(): - ctx = Context("org.sequoia-pgp.tests", - network_policy=NetworkPolicy.Offline, + ctx = Context(network_policy=NetworkPolicy.Offline, ephemeral=True) b = open(pgp, "rb").read() t = TPK.from_bytes(ctx, b) @@ -72,8 +65,7 @@ def test_equals(): assert t == u def test_clone(): - ctx = Context("org.sequoia-pgp.tests", - network_policy=NetworkPolicy.Offline, + ctx = Context(network_policy=NetworkPolicy.Offline, ephemeral=True) a = TPK.open(ctx, pgp) b = a.copy() |