Updated openstack/openstack
Project: openstack/nova  8bcb241242bd9da570e0550e4bc799238b153a95
null
Refactor unit tests for image service CRUD

Refactors the image service unit tests of the create() method to be unit
tests and not functional tests. There is no need to test whether an
image ID that is specified in the payload to the glance image service is
preserved; the unit and functional tests in the glanceclient package do
that, and besides, all this was testing was the behavior of the fake
glance client, which is pointless. There was also a test that created an
image and then tested the show method would raise InstanceNotFound if
not passing in the same instance name that was just created. This test
was removed, as ImageNotFound is already thoroughly tested in the show()
unit tests.

Missing in the existing unit tests was a test of failure conditions
resulting in error codes returned from the glanceclient.create() call,
and this patch adds a unit test that stresses the failure paths.

These new unit tests use mocks and assert that all code paths in the
create(), update() and delete() methods are fully tested.

Change-Id: I6d903979290b7d027c8dc66d2da712e1e1961a00
Related-bug: #1293938