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: I7498ea2353cccca7b23d9ef74015a566ac431f90
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis
2020-04-18 11:58:31 -05:00
parent a9d01eef93
commit ee55c043c2
15 changed files with 15 additions and 15 deletions

View File

@@ -11,10 +11,10 @@
# under the License. # under the License.
import argparse import argparse
from unittest import mock
import uuid import uuid
import fixtures import fixtures
import mock
from oslo_config import cfg from oslo_config import cfg
from keystoneclient.auth import base from keystoneclient.auth import base

View File

@@ -10,9 +10,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from unittest import mock
import uuid import uuid
import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_config import fixture as config from oslo_config import fixture as config
import stevedore import stevedore

View File

@@ -11,9 +11,9 @@
# under the License. # under the License.
import argparse import argparse
from unittest import mock
import uuid import uuid
import mock
from keystoneclient.auth.identity.generic import cli from keystoneclient.auth.identity.generic import cli
from keystoneclient import exceptions from keystoneclient import exceptions

View File

@@ -12,11 +12,11 @@
import abc import abc
import datetime import datetime
from unittest import mock
import uuid import uuid
from keystoneauth1 import fixture from keystoneauth1 import fixture
from keystoneauth1 import plugin from keystoneauth1 import plugin
import mock
from oslo_utils import timeutils from oslo_utils import timeutils
import six import six

View File

@@ -12,9 +12,9 @@
import argparse import argparse
import copy import copy
from unittest import mock
import uuid import uuid
import mock
from keystoneclient.auth.identity import v2 from keystoneclient.auth.identity import v2
from keystoneclient import exceptions from keystoneclient import exceptions

View File

@@ -12,10 +12,10 @@
import argparse import argparse
import copy import copy
from unittest import mock
import uuid import uuid
from keystoneauth1 import fixture from keystoneauth1 import fixture
import mock
from keystoneclient import access from keystoneclient import access
from keystoneclient.auth.identity import v3 from keystoneclient.auth.identity import v3

View File

@@ -11,9 +11,9 @@
# under the License. # under the License.
import argparse import argparse
from unittest import mock
import uuid import uuid
import mock
from keystoneclient.auth.identity.generic import password from keystoneclient.auth.identity.generic import password
from keystoneclient.auth.identity import v2 from keystoneclient.auth.identity import v2

View File

@@ -11,10 +11,10 @@
# under the License. # under the License.
import functools import functools
from unittest import mock
import uuid import uuid
from keystoneauth1 import fixture from keystoneauth1 import fixture
import mock
from oslo_config import cfg from oslo_config import cfg
from keystoneclient import access from keystoneclient import access

View File

@@ -13,8 +13,8 @@
import errno import errno
import os import os
import subprocess import subprocess
from unittest import mock
import mock
import testresources import testresources
from testtools import matchers from testtools import matchers

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 requests import requests
from unittest import mock
from keystoneclient import httpclient from keystoneclient import httpclient
from keystoneclient.tests.unit import utils from keystoneclient.tests.unit import utils

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 timeutils from oslo_utils import timeutils
from keystoneclient import access from keystoneclient import access

View File

@@ -15,9 +15,9 @@
import argparse import argparse
import itertools import itertools
import logging import logging
from unittest import mock
import uuid import uuid
import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_config import fixture as config from oslo_config import fixture as config
from oslo_serialization import jsonutils from oslo_serialization import jsonutils

View File

@@ -11,10 +11,11 @@
# 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 fixtures import fixtures
import uuid import uuid
import mock
import six import six
from six.moves.urllib import parse as urlparse from six.moves.urllib import parse as urlparse
from testtools import matchers from testtools import matchers

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
import uuid import uuid
from keystoneclient import exceptions from keystoneclient import exceptions

View File

@@ -10,7 +10,6 @@ fixtures>=3.0.0 # Apache-2.0/BSD
keyring>=5.5.1,<19.0.0;python_version=='2.7' # MIT/PSF keyring>=5.5.1,<19.0.0;python_version=='2.7' # MIT/PSF
keyring>=5.5.1;python_version>='3.4' # MIT/PSF keyring>=5.5.1;python_version>='3.4' # MIT/PSF
lxml!=3.7.0,>=3.4.1 # BSD lxml!=3.7.0,>=3.4.1 # BSD
mock>=2.0.0 # BSD
oauthlib>=0.6.2 # BSD oauthlib>=0.6.2 # BSD
os-client-config>=1.28.0 # Apache-2.0 os-client-config>=1.28.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0