angdraug/nova — pull request #2 by rodis (2014-07-30 16:03:56+00:00)
Title: test_direct_fetch_fail fails if the rbd module is installed

The prepare_mocks method is not called in the test and so the rbd
module is not mocked. Because of that, when the rbd module is not
installed, it is defined as None in the imagebackend module. This
is masquerading a couple of issues in the test.

* The _is_cloneable method takes one argument and so should do the
lambda function that mocks it
* The tested method(direct_fetch) and most of the methods it calls,
raise the same type of exception(ImageUnacceptable) with different
messages. Asserting that the exception is raised without checking
the message may lead to a false positive result

This commit fixies all the issues and split the test in several
tests to make different failures easier to identify.

Change-Id: I72f4c17d4ba3e284ba0c73eb4d4a8f8ea8fcbe2d
Signed-off-by: Rosario Di Somma