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: I3bd764213089a79dd56259f99da2e4634499f5ff
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-04-18 12:00:39 -05:00
parent 021e7be1d5
commit f7c8d129e0
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
61 changed files with 67 additions and 61 deletions

View File

@ -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 solum.api.controllers.camp import camp_v1_1_endpoint from solum.api.controllers.camp import camp_v1_1_endpoint
from solum import objects from solum import objects

View File

@ -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 solum.api.controllers.camp import platform_endpoints from solum.api.controllers.camp import platform_endpoints
from solum import objects from solum import objects

View File

@ -11,8 +11,8 @@
# under the License. # under the License.
import json import json
from unittest import mock
import mock
from solum.api.controllers.camp.v1_1 import assemblies from solum.api.controllers.camp.v1_1 import assemblies
from solum import objects from solum import objects

View File

@ -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 solum.api.controllers.camp.v1_1 import attribute_definitions from solum.api.controllers.camp.v1_1 import attribute_definitions
from solum import objects from solum import objects

View File

@ -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 solum.api.controllers.camp.v1_1 import extensions from solum.api.controllers.camp.v1_1 import extensions
from solum import objects from solum import objects

View File

@ -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 solum.api.controllers.camp.v1_1 import formats from solum.api.controllers.camp.v1_1 import formats
from solum import objects from solum import objects

View File

@ -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 solum.api.controllers.camp.v1_1 import parameter_definitions as pd from solum.api.controllers.camp.v1_1 import parameter_definitions as pd
from solum import objects from solum import objects

View File

@ -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 solum.api.controllers.camp.v1_1 import plans from solum.api.controllers.camp.v1_1 import plans
from solum import objects from solum import objects

View File

@ -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 solum.api.controllers.camp.v1_1 import platform from solum.api.controllers.camp.v1_1 import platform
from solum import objects from solum import objects

View File

@ -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 solum.api.controllers.camp.v1_1 import services from solum.api.controllers.camp.v1_1 import services
from solum import objects from solum import objects

View File

@ -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 solum.api.controllers.camp.v1_1.datamodel import attribute_definitions from solum.api.controllers.camp.v1_1.datamodel import attribute_definitions
from solum.api.controllers.camp.v1_1.datamodel import type_definitions as model from solum.api.controllers.camp.v1_1.datamodel import type_definitions as model

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import json import json
from unittest import mock
import mock
from solum.api.controllers.v1 import app from solum.api.controllers.v1 import app
from solum.common import exception from solum.common import exception

View File

@ -11,8 +11,8 @@
# under the License. # under the License.
import json import json
from unittest import mock
import mock
from solum.api.controllers.v1 import assembly from solum.api.controllers.v1 import assembly
from solum.api.controllers.v1.datamodel import assembly as assemblymodel from solum.api.controllers.v1.datamodel import assembly as assemblymodel

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import json import json
from unittest import mock
import mock
from solum.api.controllers.v1 import component from solum.api.controllers.v1 import component
from solum.api.controllers.v1.datamodel import component as componentmodel from solum.api.controllers.v1.datamodel import component as componentmodel

View File

@ -10,8 +10,8 @@
# 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
import pecan import pecan
from unittest import mock
import wsme import wsme
import wsmeext.pecan as wsme_pecan import wsmeext.pecan as wsme_pecan

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import json import json
from unittest import mock
import mock
from solum.api.controllers.v1.datamodel import extension as model from solum.api.controllers.v1.datamodel import extension as model
from solum.api.controllers.v1 import extension as controller from solum.api.controllers.v1 import extension as controller

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import json import json
from unittest import mock
import mock
from solum.api.controllers.v1.datamodel import infrastructure as inframodel from solum.api.controllers.v1.datamodel import infrastructure as inframodel
from solum.api.controllers.v1 import infrastructure from solum.api.controllers.v1 import infrastructure

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import json import json
from unittest import mock
import mock
from solum.api.controllers.v1 import language_pack from solum.api.controllers.v1 import language_pack
from solum.common import exception from solum.common import exception

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import json import json
from unittest import mock
import mock
from solum.api.controllers.v1.datamodel import operation as operationmodel from solum.api.controllers.v1.datamodel import operation as operationmodel
from solum.api.controllers.v1 import operation from solum.api.controllers.v1 import operation

View File

@ -11,8 +11,8 @@
# under the License. # under the License.
import json import json
from unittest import mock
import mock
from solum.api.controllers.v1.datamodel import pipeline as pipelinemodel from solum.api.controllers.v1.datamodel import pipeline as pipelinemodel
from solum.api.controllers.v1 import pipeline from solum.api.controllers.v1 import pipeline

View File

@ -11,8 +11,8 @@
# under the License. # under the License.
import json import json
from unittest import mock
import mock
from oslo_db import exception as db_exc from oslo_db import exception as db_exc
import pecan import pecan
import yaml import yaml

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import json import json
from unittest import mock
import mock
from solum.api.controllers.v1.datamodel import sensor as model from solum.api.controllers.v1.datamodel import sensor as model
from solum.api.controllers.v1 import sensor as controller from solum.api.controllers.v1 import sensor as controller

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import json import json
from unittest import mock
import mock
from solum.api.controllers.v1.datamodel import service as servicemodel from solum.api.controllers.v1.datamodel import service as servicemodel
from solum.api.controllers.v1 import service from solum.api.controllers.v1 import service

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import json import json
from unittest import mock
import mock
from oslo_config import cfg from oslo_config import cfg
from solum.api.controllers.v1 import trigger from solum.api.controllers.v1 import trigger

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import mock from unittest import mock
from solum.api.controllers.v1 import userlog from solum.api.controllers.v1 import userlog
from solum import objects from solum import objects

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import json import json
from unittest import mock
import mock
from solum.api.handlers import app_handler from solum.api.handlers import app_handler
from solum.common import exception as exc from solum.common import exception as exc

View File

@ -10,7 +10,8 @@
# 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 oslo_config import fixture as config from oslo_config import fixture as config
from solum.api import auth from solum.api import auth

View File

@ -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 solum.api.handlers import component_handler from solum.api.handlers import component_handler
from solum.tests import base from solum.tests import base

View File

@ -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 solum.api.handlers import extension_handler as extension from solum.api.handlers import extension_handler as extension
from solum.tests import base from solum.tests import base

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import json import json
from unittest import mock
import mock
from solum.api.handlers import infrastructure_handler as infra from solum.api.handlers import infrastructure_handler as infra
from solum.tests import base from solum.tests import base

View File

@ -12,7 +12,8 @@
# 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 oslo_config import cfg from oslo_config import cfg
from solum.api.handlers import language_pack_handler from solum.api.handlers import language_pack_handler

View File

@ -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 solum.api.handlers import operation_handler as operation from solum.api.handlers import operation_handler as operation
from solum.tests import base from solum.tests import base

View File

@ -12,8 +12,8 @@
# under the License. # under the License.
import json import json
from unittest import mock
import mock
from solum.api.handlers import pipeline_handler from solum.api.handlers import pipeline_handler
from solum.common import catalog from solum.common import catalog

View File

@ -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 solum.api.handlers import plan_handler from solum.api.handlers import plan_handler
from solum.tests import base from solum.tests import base

View File

@ -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 solum.api.handlers import sensor_handler as sensor from solum.api.handlers import sensor_handler as sensor
from solum.tests import base from solum.tests import base

View File

@ -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 solum.api.handlers import service_handler from solum.api.handlers import service_handler
from solum.tests import base from solum.tests import base

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import json import json
from unittest import mock
import mock
from solum.api.handlers import userlog_handler from solum.api.handlers import userlog_handler
from solum.tests import base from solum.tests import base

View File

@ -10,7 +10,8 @@
# 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 oslo_config import fixture as config from oslo_config import fixture as config
from solum.api import auth from solum.api import auth

View File

@ -12,7 +12,8 @@
# 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 oslo_config import fixture as config from oslo_config import fixture as config
from solum.api import auth from solum.api import auth

View File

@ -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 solum.common.rpc import service from solum.common.rpc import service
from solum.tests import base from solum.tests import base

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import os.path import os.path
from unittest import mock
import mock
from solum.common import catalog from solum.common import catalog
from solum.common import exception from solum.common import exception

View File

@ -13,11 +13,12 @@
from barbicanclient import client as barbicanclient from barbicanclient import client as barbicanclient
from glanceclient import client as glanceclient from glanceclient import client as glanceclient
from heatclient import client as heatclient from heatclient import client as heatclient
from unittest import mock
from keystoneclient.auth.identity import v2 as identity_v2 from keystoneclient.auth.identity import v2 as identity_v2
from keystoneclient import exceptions from keystoneclient import exceptions
from keystoneclient import session from keystoneclient import session
from mistralclient.api import client as mistralclient from mistralclient.api import client as mistralclient
import mock
from neutronclient.neutron import client as neutronclient from neutronclient.neutron import client as neutronclient
from oslo_config import cfg from oslo_config import cfg
from swiftclient import client as swiftclient from swiftclient import client as swiftclient

View File

@ -13,9 +13,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from unittest import mock
import uuid import uuid
import mock
from oslo_config import cfg from oslo_config import cfg
import wsme import wsme

View File

@ -12,8 +12,8 @@
# 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
import pycodestyle import pycodestyle
from unittest import mock
import textwrap import textwrap

View File

@ -12,7 +12,8 @@
# 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 oslo_config import cfg from oslo_config import cfg
import keystoneclient.exceptions as kc_exception # noqa import keystoneclient.exceptions as kc_exception # noqa

View File

@ -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 solum.common import exception as exc from solum.common import exception as exc
from solum.common import solum_swiftclient as swiftclient from solum.common import solum_swiftclient as swiftclient

View File

@ -11,8 +11,8 @@
# under the License. # under the License.
from io import StringIO from io import StringIO
import mock
from requests import exceptions from requests import exceptions
from unittest import mock
import urllib import urllib
from solum.common import urlfetch from solum.common import urlfetch

View File

@ -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
import yaml import yaml
from solum.common import yamlutils from solum.common import yamlutils

View File

@ -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 solum.conductor.handlers import default from solum.conductor.handlers import default
from solum.tests import base from solum.tests import base

View File

@ -13,9 +13,9 @@
# under the License. # under the License.
import json import json
from unittest import mock
from heatclient import exc from heatclient import exc
import mock
from oslo_config import cfg from oslo_config import cfg
import yaml import yaml

View File

@ -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 solum.deployer.handlers import noop as noop_handler from solum.deployer.handlers import noop as noop_handler
from solum.i18n import _ from solum.i18n import _

View File

@ -11,8 +11,8 @@
# under the License. # under the License.
import datetime import datetime
from unittest import mock
import mock
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import mock
from sqlalchemy.orm import exc as sqla_ex from sqlalchemy.orm import exc as sqla_ex
from unittest import mock
from solum.common import exception from solum.common import exception
from solum.objects import registry from solum.objects import registry

View File

@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import mock
from sqlalchemy.orm import exc from sqlalchemy.orm import exc
from unittest import mock
from solum import objects from solum import objects
from solum.objects import registry from solum.objects import registry

View File

@ -12,8 +12,8 @@
# under the License. # under the License.
import sys import sys
from unittest import mock
import mock
from solum.cmd import db_manage as cli from solum.cmd import db_manage as cli
from solum.tests import base from solum.tests import base

View File

@ -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 solum.tests import base from solum.tests import base
from solum.tests import fakes from solum.tests import fakes

View File

@ -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 solum.tests import base from solum.tests import base
from solum.tests import fakes from solum.tests import fakes

View File

@ -12,7 +12,8 @@
# 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 oslo_config import cfg from oslo_config import cfg
from solum.tests import base from solum.tests import base

View File

@ -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 solum.i18n import _ from solum.i18n import _
from solum.tests import base from solum.tests import base

View File

@ -15,8 +15,8 @@
import base64 import base64
import json import json
import os.path import os.path
from unittest import mock
import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import uuidutils from oslo_utils import uuidutils

View File

@ -6,7 +6,6 @@ hacking>=3.0,<3.1.0 # Apache-2.0
coverage>=4.5.1 # Apache-2.0 coverage>=4.5.1 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD
lxml>=4.1.1 # BSD lxml>=4.1.1 # BSD
mock>=2.0.0 # BSD
oslotest>=3.3.0 # Apache-2.0 oslotest>=3.3.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0 stestr>=1.0.0 # Apache-2.0
stevedore>=1.28.0 # Apache-2.0 stevedore>=1.28.0 # Apache-2.0