From acdecb9010df7600cff86da1bfbf579bc25f71cf Mon Sep 17 00:00:00 2001 From: Patrick Totzke Date: Sun, 17 Feb 2019 13:39:07 +0000 Subject: tests/commands/globals: Simplify template_decode test --- tests/commands/test_global.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/tests/commands/test_global.py b/tests/commands/test_global.py index 9b026e6a..dad7412c 100644 --- a/tests/commands/test_global.py +++ b/tests/commands/test_global.py @@ -103,8 +103,7 @@ class TestComposeCommand(unittest.TestCase): self.assertFalse(envelope.sign) self.assertIs(envelope.sign_key, None) - @utilities.async_test - async def test_decode_template_on_loading(self): + def test_decode_template_on_loading(self): subject = u'This is a täßϑ subject.' to = u'recipient@mail.com' _from = u'foo.bar@mail.fr' @@ -116,15 +115,8 @@ class TestComposeCommand(unittest.TestCase): self.addCleanup(os.unlink, f.name) cmd = g_commands.ComposeCommand(template=f.name) - - # Crutch to exit the giant `apply` method early. - with mock.patch( - 'alot.commands.globals.settings.get_accounts', - mock.Mock(side_effect=Stop)): - try: - await cmd.apply(mock.Mock()) - except Stop: - pass + cmd._set_envelope() + cmd._get_template(mock.Mock()) self.assertEqual({'To': [to], 'From': [_from], -- cgit v1.2.3