df23212925672e05dad0a1fe08c850c6de09ea71
[yardstick.git] / yardstick / tests / unit / benchmark / scenarios / lib / test_delete_floating_ip.py
1 ##############################################################################
2 # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 import unittest
10 import mock
11
12 from yardstick.benchmark.scenarios.lib.delete_floating_ip import DeleteFloatingIp
13
14
15 class DeleteFloatingIpTestCase(unittest.TestCase):
16
17     @mock.patch('yardstick.common.openstack_utils.get_nova_client')
18     @mock.patch('yardstick.common.openstack_utils.delete_floating_ip')
19     def test_delete_floating_ip(self, mock_get_nova_client, mock_delete_floating_ip):
20         options = {
21             'floating_ip_id': '123-123-123'
22         }
23         args = {"options": options}
24         obj = DeleteFloatingIp(args, {})
25         obj.run({})
26         self.assertTrue(mock_get_nova_client.called)
27         self.assertTrue(mock_delete_floating_ip.called)
28
29
30 def main():
31     unittest.main()
32
33
34 if __name__ == '__main__':
35     main()