diff --git a/test/test_decorators.py b/test/test_decorators.py index 4ed641a..d169d4c 100644 --- a/test/test_decorators.py +++ b/test/test_decorators.py @@ -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():