Fixed document for Grafana Port usage
[yardstick.git] / yardstick / tests / unit / benchmark / scenarios / lib / test_get_flavor.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.get_flavor import GetFlavor
13
14
15 class GetFlavorTestCase(unittest.TestCase):
16
17     @mock.patch('yardstick.common.openstack_utils.get_flavor_by_name')
18     def test_get_flavor(self, mock_get_flavor_by_name):
19         options = {
20             'flavor_name': 'yardstick_test_flavor'
21         }
22         args = {"options": options}
23         obj = GetFlavor(args, {})
24         obj.run({})
25         self.assertTrue(mock_get_flavor_by_name.called)
26
27
28 def main():
29     unittest.main()
30
31
32 if __name__ == '__main__':
33     main()