The function path now contains the function name

This commit is contained in:
Christophe de Vienne
2011-10-19 13:35:49 +02:00
parent 66f8a5305f
commit 7bb637acb1
2 changed files with 2 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ def scan_api(controller, path=[]):
a = getattr(controller, name)
if inspect.ismethod(a):
if hasattr(a, '_wsme_definition'):
yield path, a._wsme_definition
yield path + [name], a._wsme_definition
elif inspect.isclass(a):
continue
else:

View File

@@ -143,7 +143,7 @@ class TestController(unittest.TestCase):
api = list(scan_api(r))
assert len(api) == 1
path, fd = api[0]
assert path == ['ns']
assert path == ['ns', 'multiply']
assert fd.name == 'multiply'
def test_scan_subclass(self):