From 6d56c579811af39cc00df82971cebe32ba8ef5dd Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Wed, 1 Apr 2020 12:34:49 -0400 Subject: [PATCH] Remove the dependency on the "mock" package Now that we are python3 only, we should move to using the built in version of mock that supports all of our testing needs and remove the dependency on the "mock" package. This patch moves all references to "import mock" to "from unittest import mock". It also cleans up some new line inconsistency. Change-Id: I876919dfc1fa0ae36bd99e3d760e38d207ee6ef3 --- ovsdbapp/tests/base.py | 3 ++- ovsdbapp/tests/functional/schema/open_vswitch/test_impl_idl.py | 2 +- ovsdbapp/tests/unit/backend/ovs_idl/test_connection.py | 2 +- ovsdbapp/tests/unit/backend/ovs_idl/test_idlutils.py | 2 +- ovsdbapp/tests/unit/backend/test_ovs_idl.py | 2 +- ovsdbapp/tests/unit/schema/open_vswitch/test_impl_idl.py | 3 ++- ovsdbapp/tests/unit/test_api.py | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ovsdbapp/tests/base.py b/ovsdbapp/tests/base.py index 563052ab..9895b02c 100644 --- a/ovsdbapp/tests/base.py +++ b/ovsdbapp/tests/base.py @@ -15,7 +15,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from oslotest import base diff --git a/ovsdbapp/tests/functional/schema/open_vswitch/test_impl_idl.py b/ovsdbapp/tests/functional/schema/open_vswitch/test_impl_idl.py index cac5c855..900ba51e 100644 --- a/ovsdbapp/tests/functional/schema/open_vswitch/test_impl_idl.py +++ b/ovsdbapp/tests/functional/schema/open_vswitch/test_impl_idl.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from ovsdbapp import exceptions as exc from ovsdbapp.schema.open_vswitch import impl_idl diff --git a/ovsdbapp/tests/unit/backend/ovs_idl/test_connection.py b/ovsdbapp/tests/unit/backend/ovs_idl/test_connection.py index 4d1e415b..8c887e8e 100644 --- a/ovsdbapp/tests/unit/backend/ovs_idl/test_connection.py +++ b/ovsdbapp/tests/unit/backend/ovs_idl/test_connection.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from ovs import poller diff --git a/ovsdbapp/tests/unit/backend/ovs_idl/test_idlutils.py b/ovsdbapp/tests/unit/backend/ovs_idl/test_idlutils.py index ab61f33b..df176721 100644 --- a/ovsdbapp/tests/unit/backend/ovs_idl/test_idlutils.py +++ b/ovsdbapp/tests/unit/backend/ovs_idl/test_idlutils.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from ovsdbapp import api from ovsdbapp.backend.ovs_idl import idlutils diff --git a/ovsdbapp/tests/unit/backend/test_ovs_idl.py b/ovsdbapp/tests/unit/backend/test_ovs_idl.py index 50793fc2..3c36ef74 100644 --- a/ovsdbapp/tests/unit/backend/test_ovs_idl.py +++ b/ovsdbapp/tests/unit/backend/test_ovs_idl.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from ovsdbapp.backend import ovs_idl from ovsdbapp.backend.ovs_idl import idlutils diff --git a/ovsdbapp/tests/unit/schema/open_vswitch/test_impl_idl.py b/ovsdbapp/tests/unit/schema/open_vswitch/test_impl_idl.py index 68a0b730..c199df7c 100644 --- a/ovsdbapp/tests/unit/schema/open_vswitch/test_impl_idl.py +++ b/ovsdbapp/tests/unit/schema/open_vswitch/test_impl_idl.py @@ -12,7 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + import testtools from ovsdbapp import exceptions diff --git a/ovsdbapp/tests/unit/test_api.py b/ovsdbapp/tests/unit/test_api.py index 9fcc11de..897a955b 100644 --- a/ovsdbapp/tests/unit/test_api.py +++ b/ovsdbapp/tests/unit/test_api.py @@ -13,9 +13,9 @@ # under the License. import sys +from unittest import mock import fixtures -import mock import testtools from ovsdbapp import api