1 ##############################################################################
2 # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
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 ##############################################################################
12 from yardstick.benchmark.scenarios.lib.add_memory_load import AddMemoryLoad
15 class AddMemoryLoadTestCase(unittest.TestCase):
17 @mock.patch('yardstick.ssh.SSH.from_node')
18 def test_add_memory_load_with_load(self, mock_from_node):
27 mock_from_node().execute.return_value = (0, '0 2048 512', '')
28 obj = AddMemoryLoad(scenario_cfg, context_cfg)
30 self.assertTrue(mock_from_node.called)
32 @mock.patch('yardstick.ssh.SSH.from_node')
33 def test_add_memory_load_without_load(self, mock_from_node):
42 obj = AddMemoryLoad(scenario_cfg, context_cfg)
44 self.assertTrue(mock_from_node.called)
46 @mock.patch('yardstick.ssh.SSH.from_node')
47 def test_add_memory_load_without_args(self, mock_from_node):
55 obj = AddMemoryLoad(scenario_cfg, context_cfg)
57 self.assertTrue(mock_from_node.called)