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: I6a4524c3e0458747646995615535e85cde2e155f Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
parent
c90472d3e6
commit
545a34c751
@ -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 mistral.actions import std_actions as std
|
||||
from mistral.tests.unit import base
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
from mistral.actions import std_actions as std
|
||||
from mistral.tests.unit import base
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
|
||||
class EchoActionTest(base.BaseTest):
|
||||
|
@ -17,7 +17,8 @@
|
||||
import base64
|
||||
from email.header import decode_header
|
||||
from email import parser
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import six
|
||||
import testtools
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
# WITHOUT 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 mistral.actions import std_actions as std
|
||||
from mistral import exceptions as exc
|
||||
|
@ -13,8 +13,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
import requests
|
||||
|
||||
from mistral.actions import std_actions as std
|
||||
|
@ -11,8 +11,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
import requests
|
||||
|
||||
from mistral.actions import std_actions as std
|
||||
|
@ -13,7 +13,7 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from mistral.actions import std_actions as std
|
||||
from mistral import exceptions as exc
|
||||
|
@ -12,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from mistral.actions import std_actions as std
|
||||
from mistral.tests.unit import base
|
||||
|
@ -12,9 +12,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
import pecan
|
||||
import pecan.testing
|
||||
from unittest import mock
|
||||
from webtest import app as webtest_app
|
||||
|
||||
from mistral.api import app as pecan_app
|
||||
|
@ -12,7 +12,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_concurrency import processutils
|
||||
from oslo_config import cfg
|
||||
|
||||
|
@ -16,8 +16,8 @@
|
||||
import copy
|
||||
import datetime
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
import oslo_messaging
|
||||
from oslo_messaging import exceptions as oslo_exc
|
||||
|
@ -13,8 +13,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
import copy
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
import sqlalchemy as sa
|
||||
|
||||
from mistral.db.v2 import api as db_api
|
||||
|
@ -14,8 +14,8 @@
|
||||
|
||||
import copy
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
import sqlalchemy as sa
|
||||
|
||||
from mistral.db.v2 import api as db_api
|
||||
|
@ -15,8 +15,8 @@
|
||||
import copy
|
||||
import datetime
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
import six
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
@ -14,8 +14,8 @@
|
||||
|
||||
import copy
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
import sqlalchemy as sa
|
||||
|
||||
from mistral.db.v2 import api as db_api
|
||||
|
@ -19,8 +19,8 @@
|
||||
import copy
|
||||
import datetime
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
import oslo_messaging
|
||||
from oslo_utils import uuidutils
|
||||
|
@ -14,11 +14,12 @@
|
||||
|
||||
import datetime
|
||||
import json
|
||||
import mock
|
||||
import pecan
|
||||
import pecan.testing
|
||||
import requests
|
||||
import requests_mock
|
||||
from unittest import mock
|
||||
|
||||
import webob
|
||||
|
||||
from mistral.api import app as pecan_app
|
||||
|
@ -13,8 +13,8 @@
|
||||
# under the License.
|
||||
|
||||
import copy
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import uuidutils
|
||||
import sqlalchemy as sa
|
||||
|
@ -12,7 +12,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
import tooz.coordination
|
||||
from webtest import app as webtest_app
|
||||
|
@ -17,8 +17,8 @@
|
||||
import copy
|
||||
import datetime
|
||||
import json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
import sqlalchemy as sa
|
||||
|
||||
from mistral.db.v2 import api as db_api
|
||||
|
@ -14,8 +14,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
import copy
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
import sqlalchemy as sa
|
||||
|
||||
from mistral.db.v2 import api as db_api
|
||||
|
@ -15,9 +15,9 @@
|
||||
|
||||
import copy
|
||||
import datetime
|
||||
from unittest import mock
|
||||
|
||||
import json
|
||||
import mock
|
||||
import sqlalchemy as sa
|
||||
import yaml
|
||||
|
||||
|
@ -18,8 +18,8 @@ import json
|
||||
import pkg_resources as pkg
|
||||
import sys
|
||||
import time
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslotest import base
|
||||
|
@ -12,7 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import cachetools
|
||||
from oslo_config import cfg
|
||||
|
@ -10,7 +10,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from mistral.db.v2 import api as db_api
|
||||
from mistral.services import workflows as wf_service
|
||||
|
@ -12,7 +12,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
import requests
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
import cachetools
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
|
@ -12,8 +12,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
import datetime
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
|
||||
from mistral import context as auth_ctx
|
||||
|
@ -14,8 +14,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
import datetime
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
from oslo_messaging.rpc import client as rpc_client
|
||||
from oslo_utils import uuidutils
|
||||
|
@ -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 oslo_config import cfg
|
||||
import testtools
|
||||
|
@ -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 oslo_config import cfg
|
||||
|
||||
|
@ -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 mistral.db.v2 import api as db_api
|
||||
from mistral.engine import engine_server
|
||||
|
@ -12,7 +12,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from mistral.db.v2 import api as db_api
|
||||
|
@ -12,7 +12,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_db import exception as db_exc
|
||||
|
||||
|
@ -12,7 +12,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import importutils
|
||||
import testtools
|
||||
|
@ -13,7 +13,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
from eventlet import timeout
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
import requests
|
||||
|
||||
|
@ -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 oslo_config import cfg
|
||||
import osprofiler
|
||||
|
@ -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 oslo_config import cfg
|
||||
|
||||
|
@ -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 oslo_config import cfg
|
||||
|
||||
|
@ -13,7 +13,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from mistral.actions import std_actions
|
||||
|
@ -13,7 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from mistral.db.v2 import api as db_api
|
||||
from mistral.executors import default_executor as d_exe
|
||||
|
@ -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 oslo_config import cfg
|
||||
|
||||
|
@ -13,7 +13,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from mistral.actions import std_actions
|
||||
|
@ -13,8 +13,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
import testtools
|
||||
from unittest import mock
|
||||
|
||||
from mistral.actions import std_actions
|
||||
from mistral.db.v2 import api as db_api
|
||||
|
@ -13,7 +13,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
import datetime as dt
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
import requests
|
||||
|
||||
|
@ -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 oslo_config import cfg
|
||||
|
||||
|
@ -13,7 +13,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
import copy
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from mistral.actions import std_actions
|
||||
|
@ -12,7 +12,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from mistral.db.v2 import api as db_api
|
||||
|
@ -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 oslo_config import cfg
|
||||
|
||||
|
@ -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 oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
@ -13,7 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
import datetime
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from mistral.db.v2.sqlalchemy import api as db_api
|
||||
from mistral import exceptions as exc
|
||||
|
@ -17,9 +17,9 @@
|
||||
import datetime
|
||||
import json
|
||||
import sys
|
||||
from unittest import mock
|
||||
import warnings
|
||||
|
||||
import mock
|
||||
|
||||
from mistral.config import cfg
|
||||
from mistral import exceptions as exc
|
||||
|
@ -11,8 +11,8 @@
|
||||
# under the License.
|
||||
|
||||
import textwrap
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
import pycodestyle
|
||||
|
||||
from mistral.hacking import checks
|
||||
|
@ -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 oslo_config import cfg
|
||||
from stevedore import exception as sd_exc
|
||||
|
@ -13,7 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
import json
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
# under the License.
|
||||
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from mistral.db.v2 import api as db_api
|
||||
from mistral.db.v2.sqlalchemy import models
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
|
||||
import datetime
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
|
||||
from mistral.db.v2 import api as db_api
|
||||
from mistral.db.v2.sqlalchemy import models
|
||||
|
@ -13,7 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from kombu import mixins as mx
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
|
||||
# Hack for making tests works with kombu listener
|
||||
|
@ -16,8 +16,8 @@
|
||||
from mistral import exceptions as exc
|
||||
from mistral.tests.unit.rpc.kombu import base
|
||||
from mistral.tests.unit.rpc.kombu import fake_kombu
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from six import moves
|
||||
|
||||
with mock.patch.dict('sys.modules', kombu=fake_kombu):
|
||||
|
@ -17,8 +17,8 @@ from mistral import exceptions as exc
|
||||
from mistral.tests.unit.rpc.kombu import base
|
||||
from mistral.tests.unit.rpc.kombu import fake_kombu
|
||||
from mistral_lib import utils
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from six import moves
|
||||
|
||||
with mock.patch.dict('sys.modules', kombu=fake_kombu):
|
||||
|
@ -18,8 +18,8 @@ from mistral import context
|
||||
from mistral import exceptions as exc
|
||||
from mistral.tests.unit.rpc.kombu import base
|
||||
from mistral.tests.unit.rpc.kombu import fake_kombu
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
import socket
|
||||
from stevedore import driver
|
||||
|
||||
|
@ -15,9 +15,9 @@
|
||||
from eventlet import event
|
||||
from eventlet import semaphore
|
||||
from eventlet import timeout
|
||||
from unittest import mock
|
||||
|
||||
import datetime
|
||||
import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
import copy
|
||||
import time
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
|
||||
from mistral import context as auth_context
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
import datetime
|
||||
import eventlet
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from eventlet import queue
|
||||
from eventlet import timeout
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
import datetime
|
||||
import eventlet
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
|
@ -12,7 +12,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslo_config import cfg
|
||||
import six
|
||||
|
||||
|
@ -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 mistral.db.v2 import api as db_api
|
||||
from mistral.db.v2.sqlalchemy import models
|
||||
|
@ -7,7 +7,6 @@ coverage!=4.4,>=4.0 # Apache-2.0
|
||||
doc8>=0.6.0 # Apache-2.0
|
||||
Pygments>=2.2.0 # BSD license
|
||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||
mock>=2.0.0 # BSD
|
||||
nose>=1.3.7 # LGPL
|
||||
oslotest>=3.2.0 # Apache-2.0
|
||||
requests-mock>=1.2.0 # Apache-2.0
|
||||
|
Loading…
Reference in New Issue
Block a user