From 13760d78fba87570c91c0a2e702980d2ec45a0ed Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Wed, 26 Apr 2017 18:56:49 +0200 Subject: [tests] fix tests mock a renamed method. --- tests/integration/keymanager/test_keymanager.py | 2 +- tests/integration/mail/outgoing/test_outgoing.py | 4 +++- tests/integration/mail/smtp/test_gateway.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'tests/integration') diff --git a/tests/integration/keymanager/test_keymanager.py b/tests/integration/keymanager/test_keymanager.py index 86e9115f..9f81e020 100644 --- a/tests/integration/keymanager/test_keymanager.py +++ b/tests/integration/keymanager/test_keymanager.py @@ -424,7 +424,7 @@ class KeyManagerKeyManagementTestCase(KeyManagerWithSoledadTestCase): """ km = self._key_manager() - km._nicknym._async_client_pinned.request = \ + km._async_client.request = \ mock.Mock(return_value=defer.succeed("")) d = km.fetch_key(ADDRESS, "http://site.domain/key") return self.assertFailure(d, errors.KeyNotFound) diff --git a/tests/integration/mail/outgoing/test_outgoing.py b/tests/integration/mail/outgoing/test_outgoing.py index 1684a54b..1a4a7cc0 100644 --- a/tests/integration/mail/outgoing/test_outgoing.py +++ b/tests/integration/mail/outgoing/test_outgoing.py @@ -140,7 +140,8 @@ class TestOutgoingMail(KeyManagerWithSoledadTestCase): Test if message is signed with sender key. """ # mock the key fetching - self.km._fetch_keys_from_server = Mock( + # XXX this is fucking ugly. + self.km._fetch_keys_from_server_and_store_local = Mock( return_value=fail(errors.KeyNotFound())) recipient = User('ihavenopubkey@nonleap.se', 'gateway.leap.se', self.proto, ADDRESS) @@ -191,6 +192,7 @@ class TestOutgoingMail(KeyManagerWithSoledadTestCase): d.addCallback(assert_verify) return d + # TODO shouldn't depend on private method on this test d = self.outgoing_mail._maybe_encrypt_and_sign(self.raw, recipient) d.addCallback(check_signed) d.addCallback(verify) diff --git a/tests/integration/mail/smtp/test_gateway.py b/tests/integration/mail/smtp/test_gateway.py index 38abfe7f..aac90b50 100644 --- a/tests/integration/mail/smtp/test_gateway.py +++ b/tests/integration/mail/smtp/test_gateway.py @@ -144,7 +144,7 @@ class TestSmtpGateway(KeyManagerWithSoledadTestCase): self._soledad, gpgbinary=self.gpg_binary_path) yield pgp.delete_key(pubkey) # mock the key fetching - self.km._fetch_keys_from_server = Mock( + self.km._fetch_keys_from_server_and_store_local = Mock( return_value=fail(errors.KeyNotFound())) user = TEST_USER proto = getSMTPFactory({user: None}, {user: self.km}, {user: None}) -- cgit v1.2.3