diff options
author | vrs <none> | 2018-12-08 23:21:20 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2018-12-10 10:25:49 +0000 |
commit | 4180da12e3d4244557484eaa271baf604b0baa4e (patch) | |
tree | f4439d41aaa2a8924a669b43fb5db4ba17a1d0b0 /tests/commands | |
parent | f7c5b841568886be64695a14f341c4c7c58b3fba (diff) |
rename get_account_by_address to account_matching_address
... since accounts' addresses can overlap and get_account_by_address
promises too much. Also remove now-obsolete get_addresses.
Diffstat (limited to 'tests/commands')
-rw-r--r-- | tests/commands/envelope_test.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/commands/envelope_test.py b/tests/commands/envelope_test.py index b09cddaa..76aa7e88 100644 --- a/tests/commands/envelope_test.py +++ b/tests/commands/envelope_test.py @@ -186,7 +186,7 @@ class TestSignCommand(unittest.TestCase): self.assertEqual(env.sign_key, mock.sentinel.default) ui.notify.assert_called_once() - @mock.patch('alot.commands.envelope.settings.get_account_by_address', + @mock.patch('alot.commands.envelope.settings.account_matching_address', mock.Mock(side_effect=NoMatchingAccount)) def test_apply_no_keyid_nomatchingaccount(self): """If there is a nokeyid and no account can be found to match the From, @@ -359,28 +359,28 @@ class TestSendCommand(unittest.TestCase): pass @utilities.async_test - async def test_get_account_by_address_with_str(self): + async def test_account_matching_address_with_str(self): cmd = envelope.SendCommand(mail=self.mail) account = mock.Mock(wraps=self.MockedAccount()) with mock.patch( - 'alot.commands.envelope.settings.get_account_by_address', - mock.Mock(return_value=account)) as get_account_by_address: + 'alot.commands.envelope.settings.account_matching_address', + mock.Mock(return_value=account)) as account_matching_address: await cmd.apply(mock.Mock()) - get_account_by_address.assert_called_once_with('foo@example.com', - return_default=True) + account_matching_address.assert_called_once_with('foo@example.com', + return_default=True) # check that the apply did run through till the end. account.send_mail.assert_called_once_with(self.mail) @utilities.async_test - async def test_get_account_by_address_with_email_message(self): + async def test_account_matching_address_with_email_message(self): mail = email.message_from_string(self.mail) cmd = envelope.SendCommand(mail=mail) account = mock.Mock(wraps=self.MockedAccount()) with mock.patch( - 'alot.commands.envelope.settings.get_account_by_address', - mock.Mock(return_value=account)) as get_account_by_address: + 'alot.commands.envelope.settings.account_matching_address', + mock.Mock(return_value=account)) as account_matching_address: await cmd.apply(mock.Mock()) - get_account_by_address.assert_called_once_with('foo@example.com', - return_default=True) + account_matching_address.assert_called_once_with('foo@example.com', + return_default=True) # check that the apply did run through till the end. account.send_mail.assert_called_once_with(mail) |