The function path now contains the function name
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user