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: I5f86837c601eb64dff3c370decd2670f2a6276b6
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-04-18 12:01:44 -05:00 committed by wanghao
parent 0c7e97bdac
commit d949c970ad
28 changed files with 37 additions and 35 deletions

@ -16,7 +16,6 @@ iso8601==0.1.11
jsonschema==3.2.0
keystoneauth1==3.4.0
keystonemiddleware==4.17.0
mock==2.0.0
msgpack==1.0.0
os-api-ref==1.4.0
os-client-config==1.28.0

@ -4,9 +4,6 @@
# Metrics and style
hacking>=3.0.1,<3.1.0 # Apache-2.0
# Packaging
mock>=2.0.0 # BSD
# Backends
redis>=3.0.0 # MIT
pymongo>=3.6.0 # Apache-2.0

@ -14,10 +14,10 @@
# limitations under the License.
import json
from unittest import mock
import uuid
import ddt
import mock
from zaqar.common import urls
from zaqar.notification import notifier

@ -14,19 +14,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import collections
import datetime
import hashlib
import json
import math
import os
import random
import time
from unittest import mock
import uuid
import ddt
import mock
from oslo_utils import timeutils
import six
import testtools

@ -14,8 +14,8 @@
# under the License.
import sys
from unittest import mock
import mock
import testscenarios
import testtools

@ -16,9 +16,9 @@
import collections
import datetime
import time
from unittest import mock
import uuid
import mock
from oslo_utils import timeutils
from pymongo import cursor
import pymongo.errors

@ -14,9 +14,9 @@
import collections
import time
from unittest import mock
import uuid
import mock
from oslo_utils import timeutils
from oslo_utils import uuidutils
import redis

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations under
# the License.
import mock
from unittest import mock
import uuid
from zaqar.common import cache as oslo_cache

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations under
# the License.
import mock
from unittest import mock
from zaqar.storage import utils
from zaqar import tests as testing

@ -14,11 +14,11 @@
# under the License.
import json
from unittest import mock
import ddt
import mock
from oslo_utils import uuidutils
import zaqar
from zaqar.tests.unit.transport.websocket import base
from zaqar.tests.unit.transport.websocket import utils as test_utils

@ -14,12 +14,12 @@
# limitations under the License.
import json
from unittest import mock
import ddt
from keystonemiddleware import auth_token
import mock
from oslo_utils import uuidutils
from zaqar.common import consts
from zaqar.common import urls
from zaqar.tests.unit.transport.websocket import base

@ -13,9 +13,9 @@
# the License.
import json
from unittest import mock
import ddt
import mock
from oslo_utils import timeutils
from oslo_utils import uuidutils

@ -15,9 +15,9 @@
import datetime
import json
from unittest import mock
import ddt
import mock
from oslo_utils import timeutils
from oslo_utils import uuidutils
import six

@ -13,9 +13,9 @@
# the License.
import json
from unittest import mock
import ddt
import mock
from oslo_utils import uuidutils
from zaqar.common import consts

@ -15,11 +15,11 @@
import json
import time
from unittest import mock
import mock
import msgpack
from oslo_utils import uuidutils
from zaqar.common import auth
from zaqar.common import consts
from zaqar.storage import errors as storage_errors

@ -14,10 +14,10 @@
# limitations under the License.
import datetime
from unittest import mock
import ddt
import falcon
import mock
from oslo_serialization import jsonutils
from oslo_utils import timeutils
from oslo_utils import uuidutils

@ -14,10 +14,10 @@
# limitations under the License.
import datetime
from unittest import mock
import ddt
import falcon
import mock
from oslo_serialization import jsonutils
from oslo_utils import timeutils
from oslo_utils import uuidutils

@ -12,9 +12,10 @@
# License for the specific language governing permissions and limitations under
# the License.
from unittest import mock
import ddt
import falcon
import mock
from oslo_serialization import jsonutils
import six

@ -15,10 +15,10 @@
import datetime
import json
from unittest import mock
import ddt
import falcon
import mock
from oslo_serialization import jsonutils
from oslo_utils import timeutils
from oslo_utils import uuidutils

@ -14,9 +14,10 @@
# limitations under the License.
from unittest import mock
import ddt
import falcon
import mock
from oslo_serialization import jsonutils
from zaqar.storage import errors

@ -14,11 +14,11 @@
# limitations under the License.
import datetime
from unittest import mock
import uuid
import ddt
import falcon
import mock
from oslo_serialization import jsonutils
from oslo_utils import timeutils
import six

@ -13,9 +13,10 @@
# the License.
from unittest import mock
import ddt
import falcon
import mock
from oslo_serialization import jsonutils
from oslo_utils import uuidutils
import six

@ -15,10 +15,10 @@
import datetime
import json
from unittest import mock
import ddt
import falcon
import mock
from oslo_serialization import jsonutils
from oslo_utils import timeutils
from oslo_utils import uuidutils

@ -14,9 +14,10 @@
# limitations under the License.
from unittest import mock
import ddt
import falcon
import mock
from oslo_serialization import jsonutils
from zaqar.storage import errors

@ -14,10 +14,10 @@
# limitations under the License.
import datetime
from unittest import mock
import ddt
import falcon
import mock
from oslo_serialization import jsonutils
from oslo_utils import timeutils
from oslo_utils import uuidutils

@ -13,9 +13,10 @@
# the License.
from unittest import mock
import ddt
import falcon
import mock
from oslo_serialization import jsonutils
from oslo_utils import uuidutils
import six

@ -13,9 +13,10 @@
# the License.
from unittest import mock
import ddt
import falcon
import mock
from oslo_serialization import jsonutils
from oslo_utils import uuidutils

@ -13,9 +13,10 @@
# the License.
from unittest import mock
import ddt
import falcon
import mock
from oslo_serialization import jsonutils
from oslo_utils import uuidutils
import six