diff options
author | Hans Lindgren <hanlind@kth.se> | 2014-11-24 12:03:32 +0100 |
---|---|---|
committer | Sylvain Bauza <sbauza@redhat.com> | 2015-09-09 17:14:35 +0200 |
commit | 479005ce5a35039639fa809b1a4705c9d3dc28c4 (patch) | |
tree | 890ae54246732dfa2ca2eb8913c0db4627a58456 /nova/tests/unit/volume | |
parent | e68db1157a2060dad5fea8ee1980fdc232754f4b (diff) | |
download | nova-479005ce5a35039639fa809b1a4705c9d3dc28c4.tar.gz |
Consolidate code to get the correct availability zone of an instance
This makes getting the availability zone of an instance use the same
code by placing it inside the helper get_instance_availability_zone().
Related-Bug: #1390033
Change-Id: I69b98eacbc8dc91e65611d6bf07272b517fe350d
Diffstat (limited to 'nova/tests/unit/volume')
-rw-r--r-- | nova/tests/unit/volume/test_cinder.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nova/tests/unit/volume/test_cinder.py b/nova/tests/unit/volume/test_cinder.py index 4e5e4892f5..7b51c2af96 100644 --- a/nova/tests/unit/volume/test_cinder.py +++ b/nova/tests/unit/volume/test_cinder.py @@ -175,11 +175,12 @@ class CinderApiTestCase(test.NoDBTestCase): volume['availability_zone'] = 'zone1' self.assertIsNone(self.api.check_attach( self.ctx, volume, instance)) - self.assertFalse(mock_get_instance_az.called) + mock_get_instance_az.assert_called_once_with(self.ctx, instance) + mock_get_instance_az.reset_mock() volume['availability_zone'] = 'zone2' self.assertRaises(exception.InvalidVolume, self.api.check_attach, self.ctx, volume, instance) - self.assertFalse(mock_get_instance_az.called) + mock_get_instance_az.assert_called_once_with(self.ctx, instance) cinder.CONF.reset() def test_check_attach(self): |