summaryrefslogtreecommitdiff
path: root/tests/commands
diff options
context:
space:
mode:
authorBen Finney <ben+python@benfinney.id.au>2018-04-23 16:30:28 +1000
committerBen Finney <ben@benfinney.id.au>2018-04-23 19:54:46 +1000
commit018279b18e7c95b40d94a09fc68fa3b3aa1fc6b0 (patch)
tree219ede6fac37dfa3a35027dfef75c68ac689c409 /tests/commands
parent950839f390dbdcd285ceae86b7ddeb4ce62a50d4 (diff)
Wrap long statements on open-bracket syntax.
Diffstat (limited to 'tests/commands')
-rw-r--r--tests/commands/global_test.py20
-rw-r--r--tests/commands/utils_tests.py6
2 files changed, 17 insertions, 9 deletions
diff --git a/tests/commands/global_test.py b/tests/commands/global_test.py
index 102d75c2..59943e5e 100644
--- a/tests/commands/global_test.py
+++ b/tests/commands/global_test.py
@@ -50,7 +50,8 @@ class TestComposeCommand(unittest.TestCase):
return envelope
@staticmethod
- def _make_account_mock(sign_by_default=True, gpg_key=mock.sentinel.gpg_key):
+ def _make_account_mock(
+ sign_by_default=True, gpg_key=mock.sentinel.gpg_key):
account = mock.Mock()
account.sign_by_default = sign_by_default
account.gpg_key = gpg_key
@@ -153,8 +154,9 @@ class TestComposeCommand(unittest.TestCase):
cmd = g_commands.ComposeCommand(template=f.name)
# Crutch to exit the giant `apply` method early.
- with mock.patch('alot.commands.globals.settings.get_account_by_address',
- mock.Mock(side_effect=Stop)):
+ with mock.patch(
+ 'alot.commands.globals.settings.get_account_by_address',
+ mock.Mock(side_effect=Stop)):
try:
yield cmd.apply(mock.Mock())
except Stop:
@@ -189,7 +191,8 @@ class TestExternalCommand(unittest.TestCase):
def test_no_spawn_stdin_attached(self):
ui = utilities.make_ui()
- cmd = g_commands.ExternalCommand(u"test -t 0", stdin=u'0', refocus=False)
+ cmd = g_commands.ExternalCommand(
+ u"test -t 0", stdin=u'0', refocus=False)
cmd.apply(ui)
ui.notify.assert_called_once_with('', priority='error')
@@ -199,7 +202,8 @@ class TestExternalCommand(unittest.TestCase):
cmd.apply(ui)
ui.notify.assert_called_once_with('', priority='error')
- @mock.patch('alot.commands.globals.settings.get', mock.Mock(return_value=''))
+ @mock.patch(
+ 'alot.commands.globals.settings.get', mock.Mock(return_value=''))
@mock.patch.dict(os.environ, {'DISPLAY': ':0'})
def test_spawn_no_stdin_success(self):
ui = utilities.make_ui()
@@ -207,7 +211,8 @@ class TestExternalCommand(unittest.TestCase):
cmd.apply(ui)
ui.notify.assert_not_called()
- @mock.patch('alot.commands.globals.settings.get', mock.Mock(return_value=''))
+ @mock.patch(
+ 'alot.commands.globals.settings.get', mock.Mock(return_value=''))
@mock.patch.dict(os.environ, {'DISPLAY': ':0'})
def test_spawn_stdin_success(self):
ui = utilities.make_ui()
@@ -217,7 +222,8 @@ class TestExternalCommand(unittest.TestCase):
cmd.apply(ui)
ui.notify.assert_not_called()
- @mock.patch('alot.commands.globals.settings.get', mock.Mock(return_value=''))
+ @mock.patch(
+ 'alot.commands.globals.settings.get', mock.Mock(return_value=''))
@mock.patch.dict(os.environ, {'DISPLAY': ':0'})
def test_spawn_failure(self):
ui = utilities.make_ui()
diff --git a/tests/commands/utils_tests.py b/tests/commands/utils_tests.py
index 487d0d3b..c17473dc 100644
--- a/tests/commands/utils_tests.py
+++ b/tests/commands/utils_tests.py
@@ -57,7 +57,8 @@ def setUpModule():
with gpg.core.Context(armor=True) as ctx:
# Add the public and private keys. They have no password
- search_dir = os.path.join(os.path.dirname(__file__), '../static/gpg-keys')
+ search_dir = os.path.join(
+ os.path.dirname(__file__), '../static/gpg-keys')
for each in os.listdir(search_dir):
if os.path.splitext(each)[1] == '.gpg':
with open(os.path.join(search_dir, each)) as f:
@@ -106,7 +107,8 @@ class TestGetKeys(unittest.TestCase):
@inlineCallbacks
def test_get_keys_ambiguous(self):
"""Test gettings keys when when the key is ambiguous."""
- key = crypto.get_key(FPR, validate=True, encrypt=True, signed_only=False)
+ key = crypto.get_key(
+ FPR, validate=True, encrypt=True, signed_only=False)
ui = utilities.make_ui()
# Creat a ui.choice object that can satisfy twisted, but can also be