magnum/magnum/tests/unit
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
..
api Fixed the incorrect policy enforcement 2016-01-04 20:01:57 -05:00
common Create trust_id for bay 2015-12-15 11:28:23 +08:00
conductor HTTP 400 instead of 500 when Unicode Bay name 2016-01-03 22:10:05 -05:00
db Replace dict.iteritems() with dict.items() 2015-12-22 20:13:54 -05:00
objects Object: Add BayModel as an ObjectField to Bay object 2015-12-21 17:37:25 +08:00
service Decoupling magnum service from periodic task 2015-11-30 18:52:48 +00:00
servicegroup Decoupling magnum service from periodic task 2015-11-30 18:52:48 +00:00
template Improve yml template test case. 2015-11-24 16:54:41 +08:00
__init__.py Make room for functional tests 2015-04-02 12:25:43 -04:00
test_hacking.py WSGI enfore fails should return 403 instead of 500 2016-01-04 16:36:30 -05:00
test_opts.py Introduce unit test for genconfig 2015-09-03 09:02:36 +09:00