Add multinic API unit test
Multinic api unit test is not sufficient, so this patch adds a testcase for removing a fixed IP when the IP is not found. Change-Id: Ice04806269a92244bd068b90e9934eaedb17a1b4
This commit is contained in:
parent
1df291f4c2
commit
81093c0ab7
@ -171,6 +171,21 @@ class FixedIpTestV21(test.NoDBTestCase):
|
||||
resp = req.get_response(self.app)
|
||||
self.assertEqual(400, resp.status_int)
|
||||
|
||||
@mock.patch.object(compute.api.API, 'remove_fixed_ip',
|
||||
side_effect=exception.FixedIpNotFoundForSpecificInstance(
|
||||
instance_uuid=UUID, ip='10.10.10.1'))
|
||||
def test_remove_fixed_ip_not_found(self, _remove_fixed_ip):
|
||||
|
||||
body = {'remove_fixed_ip': {'address': '10.10.10.1'}}
|
||||
req = webob.Request.blank(
|
||||
self._get_url() + '/servers/%s/action' % UUID)
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.headers['content-type'] = 'application/json'
|
||||
|
||||
resp = req.get_response(self.app)
|
||||
self.assertEqual(400, resp.status_int)
|
||||
|
||||
|
||||
class FixedIpTestV2(FixedIpTestV21):
|
||||
def setUp(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user