Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library unittest.mock module instead of the third party mock lib. Change-Id: Ia552f03378bfa2d6612718eeec02da0448d322bc
This commit is contained in:
parent
ecce177c03
commit
240fcc9eca
|
@ -35,7 +35,6 @@ MarkupSafe==1.0
|
|||
mccabe==0.2.1
|
||||
metalsmith==0.13.0
|
||||
mistral-lib==0.3.0
|
||||
mock==2.0.0
|
||||
monotonic==0.6
|
||||
mox3==0.20.0
|
||||
msgpack-python==0.4.0
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
# under the License.
|
||||
|
||||
import json
|
||||
import mock
|
||||
import os
|
||||
import random
|
||||
from six.moves import configparser
|
||||
|
@ -22,6 +21,7 @@ import shutil
|
|||
import string
|
||||
import sys
|
||||
import tempfile
|
||||
from unittest import mock
|
||||
|
||||
from oslo_concurrency import processutils
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from glanceclient import exc as glance_exceptions
|
||||
import ironic_inspector_client
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from ironicclient import client as ironicclient
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from mistral_lib import actions
|
||||
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import yaml
|
||||
|
||||
from swiftclient import exceptions as swiftexceptions
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import mock
|
||||
|
||||
from unittest import mock
|
||||
|
||||
from heatclient import exc as heatexceptions
|
||||
from oslo_concurrency import processutils
|
||||
|
|
|
@ -13,7 +13,8 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import collections
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import yaml
|
||||
|
||||
from mistral_lib import actions
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import collections
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from mistral_lib import actions
|
||||
from oslo_concurrency.processutils import ProcessExecutionError
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
# under the License.
|
||||
#
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
|
||||
FAKE_STACK = {
|
||||
|
|
|
@ -15,10 +15,9 @@
|
|||
"""Unit tests for image.builder.buildah"""
|
||||
|
||||
import copy
|
||||
import mock
|
||||
|
||||
from concurrent import futures
|
||||
from concurrent.futures import ThreadPoolExecutor as tpe
|
||||
from unittest import mock
|
||||
|
||||
from tripleo_common.image.builder.buildah import BuildahBuilder as bb
|
||||
from tripleo_common.tests import base
|
||||
|
|
|
@ -13,8 +13,7 @@
|
|||
# under the License.
|
||||
#
|
||||
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from tripleo_common.image.base import BaseImageManager
|
||||
from tripleo_common.image.exception import ImageSpecificationException
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
# under the License.
|
||||
#
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from tripleo_common.image.build import ImageBuildManager
|
||||
from tripleo_common.image.exception import ImageSpecificationException
|
||||
|
|
|
@ -13,9 +13,8 @@
|
|||
# under the License.
|
||||
#
|
||||
|
||||
|
||||
import mock
|
||||
import subprocess
|
||||
from unittest import mock
|
||||
|
||||
from tripleo_common.image.exception import ImageBuilderException
|
||||
from tripleo_common.image.image_builder import DibImageBuilder
|
||||
|
|
|
@ -16,13 +16,13 @@
|
|||
import hashlib
|
||||
import io
|
||||
import json
|
||||
import mock
|
||||
import os
|
||||
import requests
|
||||
import shutil
|
||||
import six
|
||||
from six.moves.urllib.parse import urlparse
|
||||
import tempfile
|
||||
from unittest import mock
|
||||
import zlib
|
||||
|
||||
from tripleo_common.image import image_export
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
import hashlib
|
||||
import io
|
||||
import json
|
||||
import mock
|
||||
import operator
|
||||
import os
|
||||
import requests
|
||||
|
@ -24,6 +23,7 @@ from requests_mock.contrib import fixture as rm_fixture
|
|||
import six
|
||||
from six.moves.urllib.parse import urlparse
|
||||
import tempfile
|
||||
from unittest import mock
|
||||
import zlib
|
||||
|
||||
from oslo_concurrency import processutils
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
# under the License.
|
||||
#
|
||||
|
||||
|
||||
import mock
|
||||
import os
|
||||
import six
|
||||
import sys
|
||||
import tempfile
|
||||
from unittest import mock
|
||||
|
||||
import yaml
|
||||
|
||||
from tripleo_common import constants
|
||||
|
|
|
@ -19,8 +19,7 @@
|
|||
Test cases for tripleo_common.arch module.
|
||||
"""
|
||||
|
||||
import mock
|
||||
|
||||
from unittest import mock
|
||||
from unittest import TestCase
|
||||
|
||||
from tripleo_common import arch
|
||||
|
|
|
@ -14,8 +14,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
import sys
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from tripleo_common.tests import base
|
||||
from tripleo_common.tests import fake_nova
|
||||
|
|
|
@ -14,9 +14,10 @@
|
|||
|
||||
import fixtures
|
||||
import os
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import yaml
|
||||
|
||||
from mock import MagicMock
|
||||
from tripleo_common.tests import base
|
||||
from tripleo_common.inventories import TripleoInventories
|
||||
|
||||
|
|
|
@ -15,10 +15,11 @@
|
|||
import fixtures
|
||||
import os
|
||||
import sys
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import yaml
|
||||
|
||||
from heatclient.exc import HTTPNotFound
|
||||
from mock import MagicMock
|
||||
|
||||
from tripleo_common.inventory import StackOutputs
|
||||
from tripleo_common.inventory import TripleoInventory
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
# under the License.
|
||||
#
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from tripleo_common.tests import base
|
||||
from tripleo_common import update
|
||||
|
|
|
@ -12,14 +12,15 @@
|
|||
|
||||
import datetime
|
||||
import fixtures
|
||||
import mock
|
||||
import os
|
||||
from unittest import mock
|
||||
from unittest.mock import patch
|
||||
from unittest.mock import call
|
||||
import uuid
|
||||
import warnings
|
||||
|
||||
import yaml
|
||||
|
||||
from mock import call
|
||||
from mock import patch
|
||||
|
||||
from tripleo_common import constants
|
||||
from tripleo_common.tests import base
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
# limitations under the License.
|
||||
|
||||
import collections
|
||||
from unittest import mock
|
||||
|
||||
from glanceclient import exc as exceptions
|
||||
import mock
|
||||
import testtools
|
||||
|
||||
from tripleo_common.tests import base
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
# limitations under the License.
|
||||
|
||||
import collections
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from testtools import matchers
|
||||
|
||||
from tripleo_common import exception
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from heatclient import exc as heat_exc
|
||||
import six
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from tripleo_common import exception
|
||||
from tripleo_common.tests import base
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import sys
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
|
|
|
@ -14,12 +14,13 @@
|
|||
# limitations under the License.
|
||||
|
||||
import json
|
||||
import mock
|
||||
import os
|
||||
import sys
|
||||
import yaml
|
||||
from unittest import mock
|
||||
import zlib
|
||||
|
||||
import yaml
|
||||
|
||||
import six
|
||||
from swiftclient import exceptions as swiftexceptions
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_concurrency import processutils
|
||||
|
||||
from tripleo_common.tests import base
|
||||
|
|
|
@ -13,7 +13,8 @@
|
|||
# under the License.
|
||||
#
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import yaml
|
||||
|
||||
import six
|
||||
|
|
|
@ -13,10 +13,11 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import tempfile
|
||||
from unittest import mock
|
||||
|
||||
import yaml
|
||||
|
||||
from heatclient import exc as heat_exc
|
||||
import mock
|
||||
from swiftclient import exceptions as swiftexceptions
|
||||
|
||||
from tripleo_common import constants
|
||||
|
|
|
@ -11,9 +11,10 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import yaml
|
||||
|
||||
import mock
|
||||
from swiftclient import exceptions as swiftexceptions
|
||||
|
||||
from tripleo_common import constants
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from tripleo_common.tests import base
|
||||
from tripleo_common.utils import swift as swift_utils
|
||||
|
|
|
@ -12,8 +12,9 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from unittest import mock
|
||||
|
||||
import jinja2
|
||||
import mock
|
||||
import yaml
|
||||
|
||||
from heatclient import exc as heat_exc
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
from unittest import mock
|
||||
|
||||
from collections import namedtuple
|
||||
import mock
|
||||
import yaml
|
||||
|
||||
from tripleo_common.constants import PLAN_NAME_PATTERN
|
||||
|
|
Loading…
Reference in New Issue