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: Ib83e626f51e6e01898bb7931c1660a1a548500f3
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-04-18 11:59:46 -05:00
parent e651e5de51
commit 2b8282bb1e
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
34 changed files with 35 additions and 34 deletions

View File

@ -10,5 +10,4 @@ requests-mock>=1.2.0 # Apache-2.0
stestr>=2.0.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0
testscenarios>=0.4 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT testtools>=2.2.0 # MIT
mock>=2.0.0 # BSD
httplib2>=0.9.1 # MIT httplib2>=0.9.1 # MIT

View File

@ -15,8 +15,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 testtools import testtools
from unittest import mock
from troveclient.compat import auth from troveclient.compat import auth
from troveclient.compat import exceptions from troveclient.compat import exceptions

View File

@ -17,8 +17,8 @@ import collections
import json import json
import optparse import optparse
import sys import sys
from unittest import mock
import mock
import testtools import testtools
from troveclient.compat import common from troveclient.compat import common

View File

@ -12,9 +12,9 @@
# #
import os import os
from unittest import mock
import fixtures import fixtures
import mock
import sys import sys
import testtools import testtools

View File

@ -11,7 +11,7 @@
# under the License. # under the License.
# #
import mock from unittest import mock
from troveclient.tests import fakes from troveclient.tests import fakes
from troveclient.tests.osc import utils from troveclient.tests.osc import utils

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 osc_lib import exceptions from osc_lib import exceptions
from osc_lib import utils from osc_lib import utils

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 osc_lib import exceptions from osc_lib import exceptions
from osc_lib import utils from osc_lib import utils

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 osc_lib import utils from osc_lib import utils

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 osc_lib import exceptions from osc_lib import exceptions
from osc_lib import utils from osc_lib import utils

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 osc_lib import utils from osc_lib import utils

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 osc_lib import exceptions from osc_lib import exceptions
from osc_lib import utils from osc_lib import utils

View File

@ -9,7 +9,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# 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 osc_lib import exceptions from osc_lib import exceptions
from osc_lib import utils from osc_lib import utils

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 osc_lib import exceptions from osc_lib import exceptions
from osc_lib import utils from osc_lib import utils

View File

@ -15,8 +15,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 testtools import testtools
from unittest import mock
from troveclient import base from troveclient import base
from troveclient.v1 import accounts from troveclient.v1 import accounts

View File

@ -13,9 +13,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.
import mock
from mock import patch from mock import patch
import testtools import testtools
from unittest import mock
import uuid import uuid
from troveclient.v1 import backups from troveclient.v1 import backups

View File

@ -17,8 +17,8 @@
import contextlib import contextlib
import os import os
from unittest import mock
import mock
import testtools import testtools
from troveclient.apiclient import exceptions from troveclient.apiclient import exceptions

View File

@ -15,10 +15,11 @@
# 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 fixtures import fixtures
from keystoneauth1 import adapter from keystoneauth1 import adapter
import logging import logging
import mock
import requests import requests
import testtools import testtools

View File

@ -13,8 +13,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 testtools import testtools
from unittest import mock
from troveclient import base from troveclient import base
from troveclient.v1 import clusters from troveclient.v1 import clusters

View File

@ -15,8 +15,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 testtools import testtools
from unittest import mock
from troveclient import common from troveclient import common

View File

@ -15,8 +15,8 @@
# under the License. # under the License.
import json import json
import mock
import testtools import testtools
from unittest import mock
from troveclient import base from troveclient import base
from troveclient.v1 import configurations from troveclient.v1 import configurations

View File

@ -13,8 +13,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 testtools import testtools
from unittest import mock
from troveclient.v1 import databases from troveclient.v1 import databases

View File

@ -15,8 +15,8 @@
# under the License. # under the License.
import mock
import testtools import testtools
from unittest import mock
from troveclient import base from troveclient import base
from troveclient.v1 import datastores from troveclient.v1 import datastores

View File

@ -15,8 +15,8 @@
import imp import imp
import inspect import inspect
from unittest import mock
import mock
import pkg_resources import pkg_resources
import testtools import testtools

View File

@ -15,8 +15,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 testtools import testtools
from unittest import mock
from troveclient import base from troveclient import base
from troveclient.v1 import instances from troveclient.v1 import instances

View File

@ -15,8 +15,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 testtools import testtools
from unittest import mock
from troveclient.v1 import limits from troveclient.v1 import limits

View File

@ -15,8 +15,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 testtools import testtools
from unittest import mock
from troveclient import base from troveclient import base
from troveclient.v1 import management from troveclient.v1 import management

View File

@ -14,9 +14,9 @@
# under the License. # under the License.
import json import json
import mock
import testtools import testtools
from troveclient.v1 import metadata from troveclient.v1 import metadata
from unittest import mock
class TestMetadata(testtools.TestCase): class TestMetadata(testtools.TestCase):

View File

@ -14,9 +14,9 @@
# under the License. # under the License.
# #
import mock
import os import os
import testtools import testtools
from unittest import mock
from troveclient.v1 import modules from troveclient.v1 import modules

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 testtools import testtools
from unittest import mock
from troveclient.v1 import root from troveclient.v1 import root

View File

@ -15,8 +15,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 testtools import testtools
from unittest import mock
from troveclient.v1 import security_groups from troveclient.v1 import security_groups

View File

@ -13,10 +13,10 @@
import re import re
import sys import sys
from unittest import mock
import fixtures import fixtures
from keystoneauth1 import fixture from keystoneauth1 import fixture
import mock
import requests_mock import requests_mock
import six import six
import testtools import testtools

View File

@ -15,8 +15,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 testtools import testtools
from unittest import mock
from troveclient.v1 import users from troveclient.v1 import users

View File

@ -14,8 +14,9 @@
# under the License. # under the License.
import base64 import base64
from unittest import mock
import fixtures import fixtures
import mock
import re import re
import six import six
import testtools import testtools

View File

@ -13,9 +13,9 @@
# under the License. # under the License.
import os import os
from unittest import mock
import fixtures import fixtures
import mock
import requests import requests
import testtools import testtools