Merge "Adding ixia latency support for dynamic cgnapt"
[yardstick.git] / tests / unit / benchmark / scenarios / lib / test_detach_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.detach_volume import DetachVolume
14
15
16 class DetachVolumeTestCase(unittest.TestCase):
17
18     @mock.patch('yardstick.common.openstack_utils.detach_volume')
19     def test_detach_volume(self, mock_detach_volume):
20         options = {
21             'server_id': '321-321-321',
22             'volume_id': '123-123-123'
23         }
24         args = {"options": options}
25         obj = DetachVolume(args, {})
26         obj.run({})
27         self.assertTrue(mock_detach_volume.called)
28
29
30 def main():
31     unittest.main()
32
33
34 if __name__ == '__main__':
35     main()