diff options
author | Ross Brattain <ross.b.brattain@intel.com> | 2017-09-03 20:30:40 -0700 |
---|---|---|
committer | Ross Brattain <ross.b.brattain@intel.com> | 2017-09-03 20:33:52 -0700 |
commit | cc3c8c7971c6a610f2cd30d505a916c3fa29a910 (patch) | |
tree | 3cecd55dc0e6b4bb7488cc80089587537fbc1059 /tests/unit/benchmark/scenarios | |
parent | c19115bafe0141326b189f317a684bf4681c8bd0 (diff) |
test_create_keypair: fix op_utils mock and mock paramiko
Change-Id: I5c039c0d4f4ba651209c7d5ca4e748f9151b5630
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'tests/unit/benchmark/scenarios')
-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(): |