]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
GlusterFS: Various unit test improvements
authorMichael Berlin <mberlin@quobyte.com>
Mon, 19 May 2014 15:28:54 +0000 (17:28 +0200)
committerMichael Berlin <mberlin@quobyte.com>
Fri, 20 Jun 2014 13:51:30 +0000 (15:51 +0200)
commit4bac3b360d7eb27cd1ac0cb8bd7821cc0a401e01
treeab6f9df265b5fc8b25c688b1fb7380222933afc7
parente0072d5352c27dbaef4a95325ebf9e7af96f2991
GlusterFS: Various unit test improvements

Fixed bug that "_ensure_share_writable" was not mocked and therefore
"GlusterfsException" was thrown earlier than expected with an unexpected
error message.

To better guard against situations like this, I've added a helper method
"assertRaisesAndMessageMatches" to test for the thrown exception AND its
message.

Added "mox.VerifyAll()" where it was missing and cleaned up unused
mocks.

Fixed test for "create_volume_from_snapshot" (which actually tested
"create_cloned_volume").

Added tests for driver function "copy_volume_to_image".

Overall, code coverage for volume/drivers/glusterfs.py improved from 74%
to 82%.

Change-Id: I872eb477351c5406d07bbf5b748ebde2d878120a
cinder/tests/test_glusterfs.py