Skip to content

Commit

Permalink
Add test for decorating a method (re #51)
Browse files Browse the repository at this point in the history
  • Loading branch information
neithere committed Jan 2, 2014
1 parent ab3856f commit c2248ca
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ def func():
assert attr == 'new-name'


def test_named_method():
class A:
@argh.named('new-name')
def meth(self):
pass
assert getattr(A.meth, argh.constants.ATTR_NAME) == 'new-name'
assert getattr(A().meth, argh.constants.ATTR_NAME) == 'new-name'


def test_command():
@argh.command
def func():
Expand Down

0 comments on commit c2248ca

Please sign in to comment.