diff options
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/benchmark/scenarios/lib/test_create_keypair.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/unit/benchmark/scenarios/lib/test_create_keypair.py b/tests/unit/benchmark/scenarios/lib/test_create_keypair.py index 99e6b9afa..4b9b72013 100644 --- a/tests/unit/benchmark/scenarios/lib/test_create_keypair.py +++ b/tests/unit/benchmark/scenarios/lib/test_create_keypair.py @@ -8,15 +8,16 @@ ############################################################################## import unittest import mock -import paramiko from yardstick.benchmark.scenarios.lib.create_keypair import CreateKeypair +PREFIX = "yardstick.benchmark.scenarios.lib.create_keypair" -class CreateKeypairTestCase(unittest.TestCase): - @mock.patch('yardstick.common.openstack_utils.create_keypair') - def test_create_keypair(self, mock_create_keypair): +class CreateKeypairTestCase(unittest.TestCase): + @mock.patch('{}.paramiko'.format(PREFIX)) + @mock.patch('{}.op_utils'.format(PREFIX)) + def test_create_keypair(self, mock_op_utils, mock_paramiko): options = { 'key_name': 'yardstick_key', 'key_path': '/tmp/yardstick_key' @@ -24,7 +25,7 @@ class CreateKeypairTestCase(unittest.TestCase): args = {"options": options} obj = CreateKeypair(args, {}) obj.run({}) - self.assertTrue(mock_create_keypair.called) + self.assertTrue(mock_op_utils.create_keypair.called) def main(): |