diff options
| author | Todd Willey <todd@ansolabs.com> | 2010-11-01 14:13:58 -0400 |
|---|---|---|
| committer | Todd Willey <todd@ansolabs.com> | 2010-11-01 14:13:58 -0400 |
| commit | b76286c5ef2b2182cb0c2cc42b31971656e8f70f (patch) | |
| tree | 8141344278733882ddd57f9b0f5dfb1991860651 /nova/tests | |
| parent | bf15a6eb3de8c688dc1364959dd3e00d3e26a563 (diff) | |
| parent | ab1c34f71745b901f40fd6a72dffc7a29a864990 (diff) | |
Merge trunk and apply some sphinx love.
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/api/openstack/fakes.py | 1 | ||||
| -rw-r--r-- | nova/tests/api/openstack/test_api.py | 6 | ||||
| -rw-r--r-- | nova/tests/api/openstack/test_servers.py | 4 |
3 files changed, 8 insertions, 3 deletions
diff --git a/nova/tests/api/openstack/fakes.py b/nova/tests/api/openstack/fakes.py index 7ecb72ab3..1b8c18974 100644 --- a/nova/tests/api/openstack/fakes.py +++ b/nova/tests/api/openstack/fakes.py @@ -30,6 +30,7 @@ from nova import exception as exc import nova.api.openstack.auth from nova.image import service from nova.image.services import glance +from nova.tests import fake_flags from nova.wsgi import Router diff --git a/nova/tests/api/openstack/test_api.py b/nova/tests/api/openstack/test_api.py index a8c0ff9f8..dd83991b9 100644 --- a/nova/tests/api/openstack/test_api.py +++ b/nova/tests/api/openstack/test_api.py @@ -24,22 +24,28 @@ from nova.api.openstack import API from nova.api.openstack import faults from webob import Request + class APITest(unittest.TestCase): def test_exceptions_are_converted_to_faults(self): + @webob.dec.wsgify def succeed(req): return 'Succeeded' + @webob.dec.wsgify def raise_webob_exc(req): raise webob.exc.HTTPNotFound(explanation='Raised a webob.exc') + @webob.dec.wsgify def fail(req): raise Exception("Threw an exception") + @webob.dec.wsgify def raise_api_fault(req): exc = webob.exc.HTTPNotFound(explanation='Raised a webob.exc') return faults.Fault(exc) + api = API() api.application = succeed diff --git a/nova/tests/api/openstack/test_servers.py b/nova/tests/api/openstack/test_servers.py index 55efcf733..785fb6f3a 100644 --- a/nova/tests/api/openstack/test_servers.py +++ b/nova/tests/api/openstack/test_servers.py @@ -91,9 +91,7 @@ class ServersTest(unittest.TestCase): pass def instance_create(context, inst): - class Foo(object): - internal_id = 1 - return Foo() + return {'id': 1, 'internal_id': 1} def fake_method(*args, **kwargs): pass |
