Skip to content

Commit

Permalink
Add negative test fot compute controller
Browse files Browse the repository at this point in the history
Check that we are actually raising the proper exception when there is a
bad request in the compute controller create method.
  • Loading branch information
alvarolopez committed Apr 9, 2015
1 parent 91b910e commit 9bacf8e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ooi/tests/middleware/test_compute_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,26 @@ def test_create_vm(self):
self.assertExpectedResult(expected, resp)
self.assertContentType(resp)

def test_create_vm_incomplete(self):
tenant = fakes.tenants["foo"]

app = self.get_app()
headers = {
'Category': (
'compute;'
'scheme="http://schemas.ogf.org/occi/infrastructure#";'
'class="kind",'
'bar;'
'scheme="http://schemas.openstack.org/template/os#";'
'class="mixin"')
}
req = self._build_req("/compute", tenant["id"], method="POST",
headers=headers)
resp = req.get_response(app)

self.assertEqual(400, resp.status_code)
self.assertContentType(resp)


class ComputeControllerTextPlain(test_middleware.TestMiddlewareTextPlain,
TestComputeController):
Expand Down

0 comments on commit 9bacf8e

Please sign in to comment.