Skip to content

Commit

Permalink
Add the run method for the command object.
Browse files Browse the repository at this point in the history
  • Loading branch information
mblayman committed Jan 3, 2016
1 parent b7cf2cf commit d02b162
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions handroll/commands/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ def register(cls, parser):
The provided parser is a subparser from ``subparsers.add_parser``.
"""
raise NotImplementedError()

def run(self, args):
"""Run whatever action the command intends."""
raise NotImplementedError()
5 changes: 5 additions & 0 deletions handroll/tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ class TestCommand(TestCase):
def test_register_not_implemented(self):
parser = mock.Mock()
self.assertRaises(NotImplementedError, Command.register, parser)

def test_run_not_implemented(self):
args = mock.Mock()
command = Command()
self.assertRaises(NotImplementedError, command.run, args)

0 comments on commit d02b162

Please sign in to comment.