Merge "Yardstick TC083: Move sample test case netperf"
[yardstick.git] / tests / unit / benchmark / scenarios / lib / test_delete_volume.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_volume import DeleteVolume
14
15
16 class DeleteVolumeTestCase(unittest.TestCase):
17
18     @mock.patch('yardstick.common.openstack_utils.get_cinder_client')
19     @mock.patch('yardstick.common.openstack_utils.delete_volume')
20     def test_delete_volume(self, mock_get_cinder_client, mock_delete_volume):
21         options = {
22             'volume_id': '123-123-123'
23         }
24         args = {"options": options}
25         obj = DeleteVolume(args, {})
26         obj.run({})
27         self.assertTrue(mock_get_cinder_client.called)
28         self.assertTrue(mock_delete_volume.called)
29
30
31 def main():
32     unittest.main()
33
34
35 if __name__ == '__main__':
36     main()