diff options
author | 2017-08-29 00:07:35 +0000 | |
---|---|---|
committer | 2017-08-29 00:07:35 +0000 | |
commit | b583d4bfe6bc49e0f3bf4beec6612390a1d4bd24 (patch) | |
tree | 41b230ec1a663c4cb4baef4e5368098862a73835 /tests/unit/benchmark/scenarios/lib/test_delete_network.py | |
parent | a66b78d60d7d062218df8e6b9c279f7931a030cd (diff) | |
parent | d254d748b607c43167876f28c74b9ea839090df2 (diff) |
Merge "Add common openstack opertation scenarios: router & port"
Diffstat (limited to 'tests/unit/benchmark/scenarios/lib/test_delete_network.py')
-rw-r--r-- | tests/unit/benchmark/scenarios/lib/test_delete_network.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/unit/benchmark/scenarios/lib/test_delete_network.py b/tests/unit/benchmark/scenarios/lib/test_delete_network.py new file mode 100644 index 000000000..9ccaa8232 --- /dev/null +++ b/tests/unit/benchmark/scenarios/lib/test_delete_network.py @@ -0,0 +1,36 @@ +############################################################################## +# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +import unittest +import mock +import paramiko + +from yardstick.benchmark.scenarios.lib.delete_network import DeleteNetwork + + +class DeleteNetworkTestCase(unittest.TestCase): + + @mock.patch('yardstick.common.openstack_utils.get_neutron_client') + @mock.patch('yardstick.common.openstack_utils.delete_neutron_net') + def test_delete_network(self, mock_get_neutron_client, mock_delete_neutron_net): + options = { + 'network_id': '123-123-123' + } + args = {"options": options} + obj = DeleteNetwork(args, {}) + obj.run({}) + self.assertTrue(mock_get_neutron_client.called) + self.assertTrue(mock_delete_neutron_net.called) + + +def main(): + unittest.main() + + +if __name__ == '__main__': + main() |