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: I1bae5d2d97304b81588ce059916326e1117136e3 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com> Co-Authored-By: Hiroo Kitamura <hiroo.kitamura@ntt-at.co.jp>
This commit is contained in:
parent
c7b5925451
commit
1825b5c509
|
@ -13,9 +13,9 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from requests_mock.contrib import fixture as requests_mock_fixture
|
||||
import testtools
|
||||
from unittest import mock
|
||||
|
||||
from cliff import columns as cliff_columns
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@ import os
|
|||
import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
import zipfile
|
||||
|
||||
from tackerclient.common import exceptions
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
from io import StringIO
|
||||
import os
|
||||
import sys
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from oslo_utils.fixture import uuidsentinel
|
||||
import six
|
||||
|
||||
|
|
|
@ -15,8 +15,9 @@
|
|||
# under the License.
|
||||
|
||||
import ast
|
||||
from unittest import mock
|
||||
|
||||
import fixtures
|
||||
import mock
|
||||
import yaml
|
||||
|
||||
from tackerclient.common import exceptions
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
|
||||
import copy
|
||||
import json
|
||||
from unittest import mock
|
||||
import uuid
|
||||
|
||||
from keystoneclient import exceptions as k_exceptions
|
||||
import mock
|
||||
import requests
|
||||
import testtools
|
||||
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
# under the License.
|
||||
#
|
||||
|
||||
from unittest import mock
|
||||
import urllib
|
||||
|
||||
import contextlib
|
||||
import fixtures
|
||||
import mock
|
||||
import six
|
||||
import six.moves.urllib.parse as urlparse
|
||||
import sys
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
import testtools
|
||||
from unittest import mock
|
||||
|
||||
from tackerclient.client import HTTPClient
|
||||
from tackerclient.common import exceptions
|
||||
|
|
|
@ -17,12 +17,13 @@ import argparse
|
|||
import logging
|
||||
import os
|
||||
import re
|
||||
from unittest import mock
|
||||
|
||||
import six
|
||||
import sys
|
||||
|
||||
import fixtures
|
||||
from keystoneclient import session
|
||||
import mock
|
||||
import testtools
|
||||
from testtools import matchers
|
||||
|
||||
|
|
|
@ -13,9 +13,10 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import fixtures
|
||||
from keystoneclient import session
|
||||
import mock
|
||||
import requests
|
||||
import testtools
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
# 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
|
||||
import sys
|
||||
from unittest import mock
|
||||
|
||||
from tackerclient.common import exceptions
|
||||
from tackerclient.common import utils
|
||||
|
|
|
@ -14,13 +14,13 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from mock import mock_open
|
||||
from mock import patch
|
||||
import sys
|
||||
|
||||
from tackerclient.common.exceptions import InvalidInput
|
||||
from tackerclient.tacker.v1_0.vnfm import vnfd
|
||||
from tackerclient.tests.unit import test_cli10
|
||||
from unittest.mock import mock_open
|
||||
from unittest.mock import patch
|
||||
|
||||
|
||||
class CLITestV10VmVNFDJSON(test_cli10.CLITestV10Base):
|
||||
|
|
|
@ -10,12 +10,12 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from mock import mock_open
|
||||
from mock import patch
|
||||
import sys
|
||||
|
||||
from tackerclient.tacker.v1_0.nfvo import vnffgd
|
||||
from tackerclient.tests.unit import test_cli10
|
||||
from unittest.mock import mock_open
|
||||
from unittest.mock import patch
|
||||
|
||||
|
||||
class CLITestV10VmVNFFGDJSON(test_cli10.CLITestV10Base):
|
||||
|
|
|
@ -13,12 +13,11 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
|
||||
from mock import sentinel
|
||||
import testtools
|
||||
|
||||
from tackerclient.common import exceptions
|
||||
from tackerclient.tacker.v1_0.nfvo import vim_utils
|
||||
from unittest.mock import sentinel
|
||||
|
||||
|
||||
class TestVIMUtils(testtools.TestCase):
|
||||
|
|
|
@ -10,4 +10,3 @@ python-subunit>=1.0.0 # Apache-2.0/BSD
|
|||
requests-mock>=1.2.0 # Apache-2.0
|
||||
stestr>=2.0.0 # Apache-2.0
|
||||
testtools>=2.2.0 # MIT
|
||||
mock>=2.0.0 # BSD
|
||||
|
|
Loading…
Reference in New Issue