Merge "Adding ixia latency support for dynamic cgnapt"
[yardstick.git] / tests / unit / benchmark / scenarios / lib / test_delete_router_interface.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 import paramiko
12
13 from yardstick.benchmark.scenarios.lib.delete_router_interface import DeleteRouterInterface
14
15
16 class DeleteRouterInterfaceTestCase(unittest.TestCase):
17
18     @mock.patch('yardstick.common.openstack_utils.get_neutron_client')
19     @mock.patch('yardstick.common.openstack_utils.remove_interface_router')
20     def test_delete_router_interface(self, mock_get_neutron_client, mock_remove_interface_router):
21         options = {
22             'router_id': '123-123-123',
23             'subnet_id': '321-321-321'
24         }
25         args = {"options": options}
26         obj = DeleteRouterInterface(args, {})
27         obj.run({})
28         self.assertTrue(mock_get_neutron_client.called)
29         self.assertTrue(mock_remove_interface_router.called)
30
31
32 def main():
33     unittest.main()
34
35
36 if __name__ == '__main__':
37     main()