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:
parent
e651e5de51
commit
2b8282bb1e
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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):
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user