From 61174d0136a415a421bd38c846c9622fa5a25fa1 Mon Sep 17 00:00:00 2001 From: heck Date: Wed, 11 Nov 2020 17:52:16 +0100 Subject: [PATCH] rename fixtures, make distinction between import and create. (create == myself()) --- tests/conftest.py | 4 ++-- tests/test_message.py | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index c06073c..8806cbe 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -54,7 +54,7 @@ def bob_pub_key_data(datadir): @pytest.fixture() -def create_alice_identity(ctx_init, alice_sec_key_data): +def import_identity_alice(ctx_init, alice_sec_key_data): import pEp pEp.import_key(alice_sec_key_data) @@ -67,7 +67,7 @@ def create_alice_identity(ctx_init, alice_sec_key_data): @pytest.fixture() -def create_bob_identity(ctx_init, bob_pub_key_data): +def import_identity_bob(ctx_init, bob_pub_key_data): import pEp pEp.import_key(bob_pub_key_data) diff --git a/tests/test_message.py b/tests/test_message.py index 39563a2..e333514 100644 --- a/tests/test_message.py +++ b/tests/test_message.py @@ -4,11 +4,11 @@ from . import constants -def test_msg_enc_dec_roundtrip(create_alice_identity, create_bob_identity): +def test_msg_enc_dec_roundtrip(import_identity_alice, import_identity_bob): import pEp - alice = create_alice_identity - bob = create_bob_identity + alice = import_identity_alice + bob = import_identity_bob msg = pEp.Message(constants.OUTGOING_MSG, alice) msg.to = [bob] @@ -72,7 +72,7 @@ Hi world! assert dec_lines[7:] == expected_dec_lines[7:] -def test_msg_len_changes(create_alice_identity, create_bob_identity): +def test_msg_len_changes(import_identity_alice, import_identity_bob): """Test that the original message is modified after encryption. Headers are added and therefore the modified unencrypted message length @@ -84,8 +84,8 @@ def test_msg_len_changes(create_alice_identity, create_bob_identity): """ import pEp - alice = create_alice_identity - bob = create_bob_identity + alice = import_identity_alice + bob = import_identity_bob msg = pEp.outgoing_message(alice) msg.to = [bob] @@ -105,7 +105,7 @@ def test_msg_len_changes(create_alice_identity, create_bob_identity): assert msg_after_encrypt_len != msg_len -def test_dec_msg_len(create_alice_identity, create_bob_identity): +def test_dec_msg_len(import_identity_alice, import_identity_bob): """ Test that the decrypted message length is different from the original. @@ -114,8 +114,8 @@ def test_dec_msg_len(create_alice_identity, create_bob_identity): """ import pEp - alice = create_alice_identity - bob = create_bob_identity + alice = import_identity_alice + bob = import_identity_bob msg = pEp.outgoing_message(alice) msg.to = [bob] @@ -155,12 +155,12 @@ Hi world!\r assert dec_msg_len - len_extra_headers == msg_len -def test_null_char_rmed(create_alice_identity, create_bob_identity): +def test_null_char_rmed(import_identity_alice, import_identity_bob): """Test that null characters and anything after them is removed.""" import pEp - alice = create_alice_identity - bob = create_bob_identity + alice = import_identity_alice + bob = import_identity_bob msg = pEp.outgoing_message(alice) msg.to = [bob]