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:
parent
021e7be1d5
commit
f7c8d129e0
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.api.controllers.camp import camp_v1_1_endpoint
|
||||
from solum import objects
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.api.controllers.camp import platform_endpoints
|
||||
from solum import objects
|
||||
|
@ -11,8 +11,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from solum.api.controllers.camp.v1_1 import assemblies
|
||||
from solum import objects
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.api.controllers.camp.v1_1 import attribute_definitions
|
||||
from solum import objects
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.api.controllers.camp.v1_1 import extensions
|
||||
from solum import objects
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.api.controllers.camp.v1_1 import formats
|
||||
from solum import objects
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.api.controllers.camp.v1_1 import parameter_definitions as pd
|
||||
from solum import objects
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.api.controllers.camp.v1_1 import plans
|
||||
from solum import objects
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.api.controllers.camp.v1_1 import platform
|
||||
from solum import objects
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.api.controllers.camp.v1_1 import services
|
||||
from solum import objects
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# 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 type_definitions as model
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from solum.api.controllers.v1 import app
|
||||
from solum.common import exception
|
||||
|
@ -11,8 +11,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from solum.api.controllers.v1 import assembly
|
||||
from solum.api.controllers.v1.datamodel import assembly as assemblymodel
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from solum.api.controllers.v1 import component
|
||||
from solum.api.controllers.v1.datamodel import component as componentmodel
|
||||
|
@ -10,8 +10,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
import pecan
|
||||
from unittest import mock
|
||||
import wsme
|
||||
import wsmeext.pecan as wsme_pecan
|
||||
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from solum.api.controllers.v1.datamodel import extension as model
|
||||
from solum.api.controllers.v1 import extension as controller
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from solum.api.controllers.v1.datamodel import infrastructure as inframodel
|
||||
from solum.api.controllers.v1 import infrastructure
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from solum.api.controllers.v1 import language_pack
|
||||
from solum.common import exception
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from solum.api.controllers.v1.datamodel import operation as operationmodel
|
||||
from solum.api.controllers.v1 import operation
|
||||
|
@ -11,8 +11,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from solum.api.controllers.v1.datamodel import pipeline as pipelinemodel
|
||||
from solum.api.controllers.v1 import pipeline
|
||||
|
@ -11,8 +11,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_db import exception as db_exc
|
||||
import pecan
|
||||
import yaml
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from solum.api.controllers.v1.datamodel import sensor as model
|
||||
from solum.api.controllers.v1 import sensor as controller
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from solum.api.controllers.v1.datamodel import service as servicemodel
|
||||
from solum.api.controllers.v1 import service
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
|
||||
from solum.api.controllers.v1 import trigger
|
||||
|
@ -12,7 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.api.controllers.v1 import userlog
|
||||
from solum import objects
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from solum.api.handlers import app_handler
|
||||
from solum.common import exception as exc
|
||||
|
@ -10,7 +10,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import fixture as config
|
||||
|
||||
from solum.api import auth
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.api.handlers import component_handler
|
||||
from solum.tests import base
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.api.handlers import extension_handler as extension
|
||||
from solum.tests import base
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from solum.api.handlers import infrastructure_handler as infra
|
||||
from solum.tests import base
|
||||
|
@ -12,7 +12,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from solum.api.handlers import language_pack_handler
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.api.handlers import operation_handler as operation
|
||||
from solum.tests import base
|
||||
|
@ -12,8 +12,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from solum.api.handlers import pipeline_handler
|
||||
from solum.common import catalog
|
||||
|
@ -12,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.api.handlers import plan_handler
|
||||
from solum.tests import base
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.api.handlers import sensor_handler as sensor
|
||||
from solum.tests import base
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.api.handlers import service_handler
|
||||
from solum.tests import base
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from solum.api.handlers import userlog_handler
|
||||
from solum.tests import base
|
||||
|
@ -10,7 +10,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import fixture as config
|
||||
|
||||
from solum.api import auth
|
||||
|
@ -12,7 +12,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import fixture as config
|
||||
|
||||
from solum.api import auth
|
||||
|
@ -12,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.common.rpc import service
|
||||
from solum.tests import base
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
import os.path
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from solum.common import catalog
|
||||
from solum.common import exception
|
||||
|
@ -13,11 +13,12 @@
|
||||
from barbicanclient import client as barbicanclient
|
||||
from glanceclient import client as glanceclient
|
||||
from heatclient import client as heatclient
|
||||
from unittest import mock
|
||||
|
||||
from keystoneclient.auth.identity import v2 as identity_v2
|
||||
from keystoneclient import exceptions
|
||||
from keystoneclient import session
|
||||
from mistralclient.api import client as mistralclient
|
||||
import mock
|
||||
from neutronclient.neutron import client as neutronclient
|
||||
from oslo_config import cfg
|
||||
from swiftclient import client as swiftclient
|
||||
|
@ -13,9 +13,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from unittest import mock
|
||||
import uuid
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
import wsme
|
||||
|
||||
|
@ -12,8 +12,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
import pycodestyle
|
||||
from unittest import mock
|
||||
|
||||
import textwrap
|
||||
|
||||
|
@ -12,7 +12,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
import keystoneclient.exceptions as kc_exception # noqa
|
||||
|
@ -12,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.common import exception as exc
|
||||
from solum.common import solum_swiftclient as swiftclient
|
||||
|
@ -11,8 +11,8 @@
|
||||
# under the License.
|
||||
|
||||
from io import StringIO
|
||||
import mock
|
||||
from requests import exceptions
|
||||
from unittest import mock
|
||||
import urllib
|
||||
|
||||
from solum.common import urlfetch
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
import yaml
|
||||
|
||||
from solum.common import yamlutils
|
||||
|
@ -12,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.conductor.handlers import default
|
||||
from solum.tests import base
|
||||
|
@ -13,9 +13,9 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
from heatclient import exc
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
import yaml
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.deployer.handlers import noop as noop_handler
|
||||
from solum.i18n import _
|
||||
|
@ -11,8 +11,8 @@
|
||||
# under the License.
|
||||
|
||||
import datetime
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
|
||||
|
@ -12,8 +12,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from sqlalchemy.orm import exc as sqla_ex
|
||||
from unittest import mock
|
||||
|
||||
from solum.common import exception
|
||||
from solum.objects import registry
|
||||
|
@ -12,8 +12,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from sqlalchemy.orm import exc
|
||||
from unittest import mock
|
||||
|
||||
from solum import objects
|
||||
from solum.objects import registry
|
||||
|
@ -12,8 +12,8 @@
|
||||
# under the License.
|
||||
|
||||
import sys
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from solum.cmd import db_manage as cli
|
||||
from solum.tests import base
|
||||
|
@ -12,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.tests import base
|
||||
from solum.tests import fakes
|
||||
|
@ -12,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.tests import base
|
||||
from solum.tests import fakes
|
||||
|
@ -12,7 +12,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from solum.tests import base
|
||||
|
@ -12,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from solum.i18n import _
|
||||
from solum.tests import base
|
||||
|
@ -15,8 +15,8 @@
|
||||
import base64
|
||||
import json
|
||||
import os.path
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
|
@ -6,7 +6,6 @@ hacking>=3.0,<3.1.0 # Apache-2.0
|
||||
coverage>=4.5.1 # Apache-2.0
|
||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||
lxml>=4.1.1 # BSD
|
||||
mock>=2.0.0 # BSD
|
||||
oslotest>=3.3.0 # Apache-2.0
|
||||
stestr>=1.0.0 # Apache-2.0
|
||||
stevedore>=1.28.0 # Apache-2.0
|
||||
|
Loading…
Reference in New Issue
Block a user