magnum/magnum/tests/unit/api/controllers
Hongbin Lu 085631b71b Fixed the incorrect policy enforcement
In API controller, "@expose.expose" should be on top of
"@policy.enforce_wsgi". Otherwise, the output won't have the correct
format and status code. That is because "@expose.expose" will format
the exception before sending the response.

In "enforce_wsgi", use decorator module instead of "functools.wraps".
That is because decorator is signature preserving, which is
necessary for other decorator to work.

Also, added unit tests to ensure the correct error message and status
code will return if the request cannot pass the policy check.

Change-Id: I8b77ba95124c13dd1a46700bc60105bc7e33a579
Related-Bug: #1520311
2016-01-04 20:01:57 -05:00
..
v1 Fixed the incorrect policy enforcement 2016-01-04 20:01:57 -05:00
__init__.py Make room for functional tests 2015-04-02 12:25:43 -04:00
test_base.py Add test to API Version object 2015-06-12 09:13:01 +09:00
test_root.py Adding API support for magnum service 2015-09-29 18:45:49 +00:00