Use unittests.mock instead of mock lib
Change-Id: I07400c7fd829dea86774f3f695c8a976550c6baf
This commit is contained in:
parent
de4fe90b35
commit
b086b2cd50
@ -1,9 +0,0 @@
|
|||||||
# Purpose of optional-requirements is simple - list requirements which cannot
|
|
||||||
# be placed in main requirements.txt .
|
|
||||||
#
|
|
||||||
# Reasons:
|
|
||||||
# - package doesn't support the same Python versions as Rally package
|
|
||||||
# supports (see classifiers from setup.cfg)
|
|
||||||
# - package doesn't have releases
|
|
||||||
# If these rules do not relate to your package, feel free to propose it as main
|
|
||||||
# requirement to Rally (requirements.txt file).
|
|
@ -13,7 +13,6 @@ pytest-html>=1.10.0 # Mozilla Public License
|
|||||||
pytest-xdist # MIT
|
pytest-xdist # MIT
|
||||||
|
|
||||||
ddt # MIT
|
ddt # MIT
|
||||||
mock # OSI Approved :: BSD License
|
|
||||||
python-dateutil # Dual License
|
python-dateutil # Dual License
|
||||||
testtools # UNKNOWN
|
testtools # UNKNOWN
|
||||||
|
|
||||||
@ -24,3 +23,4 @@ testresources # UNKNOWN
|
|||||||
|
|
||||||
# needed for functional job
|
# needed for functional job
|
||||||
stestr # Apache Software License
|
stestr # Apache Software License
|
||||||
|
mock
|
@ -18,9 +18,9 @@ import os
|
|||||||
import re
|
import re
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import jsonschema
|
import jsonschema
|
||||||
import mock
|
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
from rally import api
|
from rally import api
|
||||||
|
@ -14,12 +14,13 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import unittest
|
|
||||||
|
import testtools
|
||||||
|
|
||||||
from tests.functional import utils
|
from tests.functional import utils
|
||||||
|
|
||||||
|
|
||||||
class VerifyTestCase(unittest.TestCase):
|
class VerifyTestCase(testtools.TestCase):
|
||||||
|
|
||||||
def test_list_plugins(self):
|
def test_list_plugins(self):
|
||||||
rally = utils.Rally(plugin_path="tests/functional/extra")
|
rally = utils.Rally(plugin_path="tests/functional/extra")
|
||||||
|
@ -13,8 +13,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.cli.commands import db
|
from rally.cli.commands import db
|
||||||
from tests.unit import fakes
|
from tests.unit import fakes
|
||||||
|
@ -16,8 +16,7 @@
|
|||||||
import collections
|
import collections
|
||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.cli import cliutils
|
from rally.cli import cliutils
|
||||||
from rally.cli.commands import deployment
|
from rally.cli.commands import deployment
|
||||||
|
@ -16,10 +16,9 @@
|
|||||||
import collections
|
import collections
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
import json
|
import json
|
||||||
|
from unittest import mock
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.cli.commands import env
|
from rally.cli.commands import env
|
||||||
from rally.env import env_mgr
|
from rally.env import env_mgr
|
||||||
from rally import exceptions
|
from rally import exceptions
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import io
|
import io
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.cli import cliutils
|
from rally.cli import cliutils
|
||||||
from rally.cli.commands import plugin as plugin_cmd
|
from rally.cli.commands import plugin as plugin_cmd
|
||||||
|
@ -18,9 +18,9 @@ import io
|
|||||||
import json
|
import json
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
import rally
|
import rally
|
||||||
from rally import api
|
from rally import api
|
||||||
|
@ -15,8 +15,7 @@
|
|||||||
|
|
||||||
import io
|
import io
|
||||||
import tempfile
|
import tempfile
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.cli import cliutils
|
from rally.cli import cliutils
|
||||||
from rally.cli.commands import verify
|
from rally.cli.commands import verify
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import io
|
import io
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
import sqlalchemy.exc
|
import sqlalchemy.exc
|
||||||
|
|
||||||
from rally.cli import cliutils
|
from rally.cli import cliutils
|
||||||
|
@ -13,10 +13,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import io
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
from six import moves
|
|
||||||
|
|
||||||
from rally.cli import envutils
|
from rally.cli import envutils
|
||||||
from rally import exceptions
|
from rally import exceptions
|
||||||
@ -34,7 +33,7 @@ class EnvUtilsTestCase(test.TestCase):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
with mock.patch("sys.stdout",
|
with mock.patch("sys.stdout",
|
||||||
new_callable=moves.StringIO) as mock_stdout:
|
new_callable=io.StringIO) as mock_stdout:
|
||||||
test_function()
|
test_function()
|
||||||
self.assertEqual("Missing argument: --test_missing_arg\n",
|
self.assertEqual("Missing argument: --test_missing_arg\n",
|
||||||
mock_stdout.getvalue())
|
mock_stdout.getvalue())
|
||||||
|
@ -16,9 +16,7 @@
|
|||||||
"""Tests for db.api layer."""
|
"""Tests for db.api layer."""
|
||||||
|
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
from six import moves
|
|
||||||
|
|
||||||
from rally.common import db
|
from rally.common import db
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -122,12 +120,12 @@ class TasksTestCase(test.DBTestCase):
|
|||||||
|
|
||||||
def test_task_list(self):
|
def test_task_list(self):
|
||||||
INIT = consts.TaskStatus.INIT
|
INIT = consts.TaskStatus.INIT
|
||||||
task_init = sorted(self._create_task()["uuid"] for i in moves.range(3))
|
task_init = sorted(self._create_task()["uuid"] for i in range(3))
|
||||||
FINISHED = consts.TaskStatus.FINISHED
|
FINISHED = consts.TaskStatus.FINISHED
|
||||||
task_finished = sorted(self._create_task(
|
task_finished = sorted(self._create_task(
|
||||||
{"status": FINISHED,
|
{"status": FINISHED,
|
||||||
"env_uuid": self.env["uuid"]}
|
"env_uuid": self.env["uuid"]}
|
||||||
)["uuid"] for i in moves.range(3))
|
)["uuid"] for i in range(3))
|
||||||
|
|
||||||
task_all = sorted(task_init + task_finished)
|
task_all = sorted(task_init + task_finished)
|
||||||
|
|
||||||
|
@ -22,11 +22,11 @@ import iso8601
|
|||||||
import json
|
import json
|
||||||
import pickle
|
import pickle
|
||||||
import pprint
|
import pprint
|
||||||
|
from unittest import mock
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import alembic
|
import alembic
|
||||||
import jsonschema
|
import jsonschema
|
||||||
import mock
|
|
||||||
from oslo_db.sqlalchemy import test_migrations
|
from oslo_db.sqlalchemy import test_migrations
|
||||||
from oslo_db.sqlalchemy import utils as db_utils
|
from oslo_db.sqlalchemy import utils as db_utils
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
@ -14,7 +14,8 @@
|
|||||||
|
|
||||||
"""Tests for custom sqlalchemy types"""
|
"""Tests for custom sqlalchemy types"""
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
|
||||||
from rally.common.db import sa_types
|
from rally.common.db import sa_types
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from rally.common.io import junit
|
from rally.common.io import junit
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -12,8 +12,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.common.io import subunit_v2
|
from rally.common.io import subunit_v2
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
"""Tests for db.deploy layer."""
|
"""Tests for db.deploy layer."""
|
||||||
|
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from rally.common import objects
|
from rally.common import objects
|
||||||
from rally import consts
|
from rally import consts
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
|
|
||||||
import collections
|
import collections
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.common import objects
|
from rally.common import objects
|
||||||
from rally import consts
|
from rally import consts
|
||||||
|
@ -15,8 +15,7 @@
|
|||||||
|
|
||||||
import copy
|
import copy
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.common import objects
|
from rally.common import objects
|
||||||
from rally import consts
|
from rally import consts
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from rally.common import objects
|
from rally.common import objects
|
||||||
from rally import exceptions
|
from rally import exceptions
|
||||||
|
@ -13,10 +13,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.common.plugin import discover
|
from rally.common.plugin import discover
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.common import broker
|
from rally.common import broker
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.common import fileutils
|
from rally.common import fileutils
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import logging # noqa
|
import logging # noqa
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.common import logging as rally_logging
|
from rally.common import logging as rally_logging
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
@ -93,7 +92,7 @@ class RallyContaxtAdapterTestCase(test.TestCase):
|
|||||||
|
|
||||||
foo()
|
foo()
|
||||||
# the number of the line which calls logging_method
|
# the number of the line which calls logging_method
|
||||||
lineno = 92
|
lineno = 91
|
||||||
self.assertEqual((__file__, lineno, "logging_method()"), self.caller)
|
self.assertEqual((__file__, lineno, "logging_method()"), self.caller)
|
||||||
|
|
||||||
@mock.patch("rally.common.logging.getLogger")
|
@mock.patch("rally.common.logging.getLogger")
|
||||||
@ -110,7 +109,7 @@ class RallyContaxtAdapterTestCase(test.TestCase):
|
|||||||
foo(1)
|
foo(1)
|
||||||
|
|
||||||
# the number of the line which calls foo
|
# the number of the line which calls foo
|
||||||
lineno = 110
|
lineno = 109
|
||||||
mock_get_logger.assert_called_once_with("%s:%s" % (__file__, lineno))
|
mock_get_logger.assert_called_once_with("%s:%s" % (__file__, lineno))
|
||||||
logger = mock_get_logger.return_value
|
logger = mock_get_logger.return_value
|
||||||
self.assertEqual(1, logger.warning.call_count)
|
self.assertEqual(1, logger.warning.call_count)
|
||||||
@ -129,7 +128,7 @@ class RallyContaxtAdapterTestCase(test.TestCase):
|
|||||||
radapter.exception(Exception("!2!"))
|
radapter.exception(Exception("!2!"))
|
||||||
|
|
||||||
# the number of the line which calls foo
|
# the number of the line which calls foo
|
||||||
lineno = 129
|
lineno = 128
|
||||||
mock_get_logger.assert_called_once_with("%s:%s" % (__file__, lineno))
|
mock_get_logger.assert_called_once_with("%s:%s" % (__file__, lineno))
|
||||||
|
|
||||||
logger = mock_get_logger.return_value
|
logger = mock_get_logger.return_value
|
||||||
@ -146,7 +145,7 @@ class RallyContaxtAdapterTestCase(test.TestCase):
|
|||||||
radapter.error("foo", "bar")
|
radapter.error("foo", "bar")
|
||||||
|
|
||||||
# the number of the line which calls foo
|
# the number of the line which calls foo
|
||||||
lineno = 146
|
lineno = 145
|
||||||
mock_get_logger.assert_called_once_with("%s:%s" % (__file__, lineno))
|
mock_get_logger.assert_called_once_with("%s:%s" % (__file__, lineno))
|
||||||
|
|
||||||
logger = mock_get_logger.return_value
|
logger = mock_get_logger.return_value
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from rally.common import opts
|
from rally.common import opts
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -19,9 +19,9 @@ import string
|
|||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
from rally.common import utils
|
from rally.common import utils
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from rally.common import version
|
from rally.common import version
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -17,7 +17,7 @@ from docutils.parsers import rst
|
|||||||
from docutils import utils
|
from docutils import utils
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
|
|
||||||
@mock.patch.object(sys, "stderr")
|
@mock.patch.object(sys, "stderr")
|
||||||
|
3
tests/unit/env/test_env_mgr.py
vendored
3
tests/unit/env/test_env_mgr.py
vendored
@ -15,8 +15,7 @@
|
|||||||
import copy
|
import copy
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.env import env_mgr
|
from rally.env import env_mgr
|
||||||
from rally.env import platform
|
from rally.env import platform
|
||||||
|
@ -15,8 +15,7 @@
|
|||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally import api
|
from rally import api
|
||||||
from rally.common import utils as rally_utils
|
from rally.common import utils as rally_utils
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
|
||||||
from rally import exceptions
|
from rally import exceptions
|
||||||
from rally.plugins.common.contexts import dummy
|
from rally.plugins.common.contexts import dummy
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -13,8 +13,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally import exceptions
|
from rally import exceptions
|
||||||
from rally.plugins.common.exporters.elastic import client
|
from rally.plugins.common.exporters.elastic import client
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
import json
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import json
|
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally import exceptions
|
from rally import exceptions
|
||||||
from rally.plugins.common.exporters.elastic import exporter as elastic
|
from rally.plugins.common.exporters.elastic import exporter as elastic
|
||||||
|
@ -13,8 +13,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.plugins.common.exporters import html
|
from rally.plugins.common.exporters import html
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
|
|
||||||
import collections
|
import collections
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.common import version as rally_version
|
from rally.common import version as rally_version
|
||||||
from rally.plugins.common.exporters import json_exporter
|
from rally.plugins.common.exporters import json_exporter
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
|
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.plugins.common.exporters import junit
|
from rally.plugins.common.exporters import junit
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -13,8 +13,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.plugins.common.exporters import trends
|
from rally.plugins.common.exporters import trends
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally import consts
|
from rally import consts
|
||||||
from rally.plugins.common.hook import sys_call
|
from rally.plugins.common.hook import sys_call
|
||||||
|
@ -13,8 +13,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.plugins.common.hook.triggers import event
|
from rally.plugins.common.hook.triggers import event
|
||||||
from rally.task import hook
|
from rally.task import hook
|
||||||
|
@ -13,8 +13,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.plugins.common.hook.triggers import periodic
|
from rally.plugins.common.hook.triggers import periodic
|
||||||
from rally.task import hook
|
from rally.task import hook
|
||||||
|
@ -13,8 +13,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.plugins.common.runners import constant
|
from rally.plugins.common.runners import constant
|
||||||
from rally.task import runner
|
from rally.task import runner
|
||||||
|
@ -13,8 +13,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.plugins.common.runners import rps
|
from rally.plugins.common.runners import rps
|
||||||
from rally.task import runner
|
from rally.task import runner
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from rally.plugins.common.runners import serial
|
from rally.plugins.common.runners import serial
|
||||||
from tests.unit import fakes
|
from tests.unit import fakes
|
||||||
|
@ -10,9 +10,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.plugins.common.scenarios.dummy import dummy
|
from rally.plugins.common.scenarios.dummy import dummy
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.plugins.common.scenarios.requests import http_requests
|
from rally.plugins.common.scenarios.requests import http_requests
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.plugins.common.scenarios.requests import utils
|
from rally.plugins.common.scenarios.requests import utils
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from rally import exceptions
|
from rally import exceptions
|
||||||
from rally.plugins.common import types
|
from rally.plugins.common import types
|
||||||
|
@ -12,11 +12,12 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import ddt
|
|
||||||
import mock
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
|
import ddt
|
||||||
|
|
||||||
import rally
|
import rally
|
||||||
from rally.common.plugin import plugin
|
from rally.common.plugin import plugin
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
import collections
|
import collections
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.common import utils
|
from rally.common import utils
|
||||||
from rally.plugins.common.verification import reporters
|
from rally.plugins.common.verification import reporters
|
||||||
|
@ -13,8 +13,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally import exceptions
|
from rally import exceptions
|
||||||
from rally.plugins.common.verification import testr
|
from rally.plugins.common.verification import testr
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.common.plugin import plugin
|
from rally.common.plugin import plugin
|
||||||
from rally.task.processing import charts
|
from rally.task.processing import charts
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
|
|
||||||
import collections
|
import collections
|
||||||
import json
|
import json
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.task.processing import plot
|
from rally.task.processing import plot
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.task import atomic
|
from rally.task import atomic
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -13,8 +13,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally import exceptions
|
from rally import exceptions
|
||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
@ -17,8 +17,7 @@
|
|||||||
|
|
||||||
import collections
|
import collections
|
||||||
import threading
|
import threading
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.common import objects
|
from rally.common import objects
|
||||||
from rally import consts
|
from rally import consts
|
||||||
|
@ -12,8 +12,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import jsonschema
|
import jsonschema
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.task import exporter
|
from rally.task import exporter
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -15,8 +15,9 @@
|
|||||||
|
|
||||||
"""Tests for HookExecutor and Hook classes."""
|
"""Tests for HookExecutor and Hook classes."""
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally import consts
|
from rally import consts
|
||||||
from rally.task import hook
|
from rally.task import hook
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
|
|
||||||
import collections
|
import collections
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.plugins.common.runners import serial
|
from rally.plugins.common.runners import serial
|
||||||
from rally.task import runner
|
from rally.task import runner
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from rally import exceptions
|
from rally import exceptions
|
||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from rally import exceptions
|
from rally import exceptions
|
||||||
from rally.task import service
|
from rally.task import service
|
||||||
|
@ -13,8 +13,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.common.plugin import plugin
|
from rally.common.plugin import plugin
|
||||||
from rally.task import sla
|
from rally.task import sla
|
||||||
|
@ -13,8 +13,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally import exceptions
|
from rally import exceptions
|
||||||
from rally.task import task_cfg
|
from rally.task import task_cfg
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from rally.common.plugin import plugin
|
from rally.common.plugin import plugin
|
||||||
from rally.task import scenario
|
from rally.task import scenario
|
||||||
|
@ -15,11 +15,11 @@
|
|||||||
|
|
||||||
import collections
|
import collections
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
|
from unittest import mock
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
from jsonschema import exceptions as schema_exceptions
|
from jsonschema import exceptions as schema_exceptions
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally import exceptions
|
from rally import exceptions
|
||||||
from rally.task import utils
|
from rally.task import utils
|
||||||
|
@ -16,9 +16,9 @@
|
|||||||
import fixtures
|
import fixtures
|
||||||
from fixtures._fixtures.tempdir import TempDir
|
from fixtures._fixtures.tempdir import TempDir
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import mock
|
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
from rally.common import cfg
|
from rally.common import cfg
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
|
|
||||||
import copy
|
import copy
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally import api
|
from rally import api
|
||||||
from rally.common import cfg
|
from rally.common import cfg
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from rally import exceptions
|
from rally import exceptions
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -13,8 +13,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from tests.ci import pytest_launcher
|
from tests.ci import pytest_launcher
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -12,8 +12,7 @@
|
|||||||
|
|
||||||
import ast
|
import ast
|
||||||
import sys
|
import sys
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
from tests.unit import test_mock
|
from tests.unit import test_mock
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from rally.utils import encodeutils
|
from rally.utils import encodeutils
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -16,9 +16,9 @@
|
|||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
import socket
|
import socket
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
import paramiko
|
import paramiko
|
||||||
|
|
||||||
from rally import exceptions
|
from rally import exceptions
|
||||||
|
@ -12,10 +12,10 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.utils import strutils
|
from rally.utils import strutils
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from rally.verification import context
|
from rally.verification import context
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -12,8 +12,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally import exceptions
|
from rally import exceptions
|
||||||
from rally.verification import manager
|
from rally.verification import manager
|
||||||
|
@ -12,8 +12,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import jsonschema
|
import jsonschema
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.verification import reporter
|
from rally.verification import reporter
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
|
|
||||||
import configparser
|
import configparser
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from rally.verification import utils
|
from rally.verification import utils
|
||||||
from tests.unit import test
|
from tests.unit import test
|
||||||
|
Loading…
Reference in New Issue
Block a user