Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanronen committed Sep 13, 2019
1 parent a7e363a commit 3b35f0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions flask_restplus/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def __init__(self, name, description=None, path=None, decorators=None, validate=
self.apis = []
if 'api' in kwargs:
self.apis.append(kwargs['api'])
kwargs['api'].add_namespace(self)

@property
def path(self):
Expand Down
6 changes: 6 additions & 0 deletions tests/test_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,9 @@ def post(self):
client.post_json('/apples/validation/', data)

assert Payload.payload == data

def test_api_namespaces(self, app):
api = restplus.Api(app, validate=True)
ns1 = Namespace('ns1', api=api)

assert ns1 in api.namespaces

0 comments on commit 3b35f0c

Please sign in to comment.