summaryrefslogtreecommitdiff
path: root/tests/commands/init_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/commands/init_test.py')
-rw-r--r--tests/commands/init_test.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/commands/init_test.py b/tests/commands/init_test.py
index f5a37997..5caf7eb0 100644
--- a/tests/commands/init_test.py
+++ b/tests/commands/init_test.py
@@ -7,6 +7,8 @@ from __future__ import absolute_import
import argparse
import unittest
+import mock
+
from alot import commands
from alot.commands import thread
@@ -28,3 +30,16 @@ class TestCommandFactory(unittest.TestCase):
self.assertIsInstance(cmd, thread.SaveAttachmentCommand)
self.assertTrue(cmd.all)
self.assertEqual(cmd.path, u'/foo')
+
+
+class TestRegisterCommand(unittest.TestCase):
+ """Tests for the registerCommand class."""
+
+ def test_registered(self):
+ """using registerCommand adds to the COMMANDS dict."""
+ with mock.patch('alot.commands.COMMANDS', {'foo': {}}):
+ @commands.registerCommand('foo', 'test')
+ def foo():
+ pass
+
+ self.assertIn('test', commands.COMMANDS['foo'])