Merge "Proposing Abhijit Sinha as a committer in Yardstick"
[yardstick.git] / yardstick / tests / unit / benchmark / scenarios / lib / test_attach_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
12 from yardstick.benchmark.scenarios.lib.attach_volume import AttachVolume
13
14
15 class AttachVolumeTestCase(unittest.TestCase):
16
17     @mock.patch('yardstick.common.openstack_utils.attach_server_volume')
18     def test_attach_volume(self, mock_attach_server_volume):
19         options = {
20             'volume_id': '123-456-000',
21             'server_id': '000-123-456'
22         }
23         args = {"options": options}
24         obj = AttachVolume(args, {})
25         obj.run({})
26         self.assertTrue(mock_attach_server_volume.called)
27
28
29 def main():
30     unittest.main()
31
32
33 if __name__ == '__main__':
34     main()