diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2017-08-15 20:02:33 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2017-08-16 09:10:09 +0100 |
commit | 2cd61c97d1f27ef262db7913822d0aa34cf70f98 (patch) | |
tree | 7400b9cbcd04d08593b1c968e7bd3bf98ef20db7 /tests/commands | |
parent | 5dee3b158fa5e0c19b5544a9aab928d80339db25 (diff) |
fix envelope tests
This instantiates an actual Envelope object instead of a Mock object
for use in the tests for envelope commands. The tests then do not fail
when they hit implicit getters of the form envelope['From'].
Diffstat (limited to 'tests/commands')
-rw-r--r-- | tests/commands/envelope_test.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/commands/envelope_test.py b/tests/commands/envelope_test.py index 37ea9eed..956e01e2 100644 --- a/tests/commands/envelope_test.py +++ b/tests/commands/envelope_test.py @@ -170,10 +170,10 @@ class TestSignCommand(unittest.TestCase): @staticmethod def _make_ui_mock(): """Create a mock for the ui and envelope and return them.""" - envelope = mock.Mock() + envelope = Envelope() + envelope['From'] = 'foo <foo@example.com>' envelope.sign = mock.sentinel.default envelope.sign_key = mock.sentinel.default - envelope.headers = {'From': ['foo <foo@example.com>']} ui = mock.Mock(current_buffer=mock.Mock(envelope=envelope)) return envelope, ui |