From cc3c8c7971c6a610f2cd30d505a916c3fa29a910 Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Sun, 3 Sep 2017 20:30:40 -0700 Subject: test_create_keypair: fix op_utils mock and mock paramiko Change-Id: I5c039c0d4f4ba651209c7d5ca4e748f9151b5630 Signed-off-by: Ross Brattain --- tests/unit/benchmark/scenarios/lib/test_create_keypair.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tests/unit/benchmark') 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(): -- cgit 1.2.3-korg