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: If70feb43be0b12c582bc4a9f27faa8f83de93774
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis
2020-04-18 11:59:18 -05:00
parent 5a332338e1
commit 85f1e46944
17 changed files with 17 additions and 17 deletions

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.
import mock
from openstack import connection as sdk_connection from openstack import connection as sdk_connection
import testtools import testtools
from unittest import mock
from senlinclient import plugin from senlinclient import plugin

View File

@@ -11,7 +11,8 @@
# under the License. # under the License.
from heatclient.common import template_utils from heatclient.common import template_utils
import mock from unittest import mock
import six import six
import testtools import testtools

View File

@@ -11,8 +11,8 @@
# under the License. # under the License.
import sys import sys
from unittest import mock
import mock
from osc_lib.tests import utils from osc_lib.tests import utils
import requests import requests

View File

@@ -11,8 +11,8 @@
# under the License. # under the License.
import copy import copy
from unittest import mock
import mock
from openstack import exceptions as sdk_exc from openstack import exceptions as sdk_exc
from osc_lib import exceptions as exc from osc_lib import exceptions as exc

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 senlinclient.tests.unit.v1 import fakes from senlinclient.tests.unit.v1 import fakes
from senlinclient.v1 import build_info as osc_build_info from senlinclient.v1 import build_info as osc_build_info

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 testtools import testtools
from unittest import mock
from senlinclient import plugin from senlinclient import plugin
from senlinclient.v1 import client from senlinclient.v1 import client

View File

@@ -12,8 +12,8 @@
import copy import copy
import subprocess import subprocess
from unittest import mock
import mock
from openstack import exceptions as sdk_exc from openstack import exceptions as sdk_exc
from osc_lib import exceptions as exc from osc_lib import exceptions as exc
import six import six

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 senlinclient.tests.unit.v1 import fakes from senlinclient.tests.unit.v1 import fakes
from senlinclient.v1 import cluster_policy as osc_cluster_policy from senlinclient.v1 import cluster_policy as osc_cluster_policy

View File

@@ -11,8 +11,8 @@
# under the License. # under the License.
import copy import copy
from unittest import mock
import mock
from openstack import exceptions as sdk_exc from openstack import exceptions as sdk_exc
from osc_lib import exceptions as exc from osc_lib import exceptions as exc

View File

@@ -11,8 +11,8 @@
# under the License. # under the License.
import copy import copy
from unittest import mock
import mock
from openstack import exceptions as sdk_exc from openstack import exceptions as sdk_exc
from osc_lib import exceptions as exc from osc_lib import exceptions as exc
import six import six

View File

@@ -11,8 +11,8 @@
# under the License. # under the License.
import copy import copy
from unittest import mock
import mock
from openstack import exceptions as sdk_exc from openstack import exceptions as sdk_exc
from osc_lib import exceptions as exc from osc_lib import exceptions as exc
import six import six

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.
import mock
from openstack import exceptions as sdk_exc from openstack import exceptions as sdk_exc
from osc_lib import exceptions as exc from osc_lib import exceptions as exc
from unittest import mock
from senlinclient.tests.unit.v1 import fakes from senlinclient.tests.unit.v1 import fakes
from senlinclient.v1 import policy_type as osc_policy_type from senlinclient.v1 import policy_type as osc_policy_type

View File

@@ -11,8 +11,8 @@
# under the License. # under the License.
import copy import copy
from unittest import mock
import mock
from openstack import exceptions as sdk_exc from openstack import exceptions as sdk_exc
from osc_lib import exceptions as exc from osc_lib import exceptions as exc
from osc_lib import utils from osc_lib import utils

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.
import mock
from openstack import exceptions as sdk_exc from openstack import exceptions as sdk_exc
from osc_lib import exceptions as exc from osc_lib import exceptions as exc
from unittest import mock
from senlinclient.tests.unit.v1 import fakes from senlinclient.tests.unit.v1 import fakes
from senlinclient.v1 import profile_type as osc_profile_type from senlinclient.v1 import profile_type as osc_profile_type

View File

@@ -11,8 +11,8 @@
# under the License. # under the License.
import copy import copy
from unittest import mock
import mock
from openstack import exceptions as sdk_exc from openstack import exceptions as sdk_exc
from osc_lib import exceptions as exc from osc_lib import exceptions as exc
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 senlinclient.tests.unit.v1 import fakes from senlinclient.tests.unit.v1 import fakes
from senlinclient.v1 import service as osc_service from senlinclient.v1 import service as osc_service

View File

@@ -8,7 +8,6 @@ hacking>=1.1.0,<1.2.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD
requests-mock>=1.2.0 # Apache-2.0 requests-mock>=1.2.0 # Apache-2.0
mock>=2.0.0 # BSD
python-openstackclient>=3.12.0 # Apache-2.0 python-openstackclient>=3.12.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0
setuptools!=24.0.0,!=34.0.0,!=34.0.1,!=34.0.2,!=34.0.3,!=34.1.0,!=34.1.1,!=34.2.0,!=34.3.0,!=34.3.1,!=34.3.2,!=36.2.0,>=21.0.0 # PSF/ZPL setuptools!=24.0.0,!=34.0.0,!=34.0.1,!=34.0.2,!=34.0.3,!=34.1.0,!=34.1.1,!=34.2.0,!=34.3.0,!=34.3.1,!=34.3.2,!=36.2.0,>=21.0.0 # PSF/ZPL