Merge "Use unittest.mock instead of third party mock"

This commit is contained in:
Zuul 2020-04-22 16:44:37 +00:00 committed by Gerrit Code Review
commit 494bbe9548
54 changed files with 59 additions and 54 deletions

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from kuryr_kubernetes.tests import base as test_base

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from kuryr_kubernetes.tests import base as test_base

View File

@ -13,8 +13,8 @@
# under the License.
import io
from unittest import mock
import mock
from oslo_serialization import jsonutils
from kuryr_kubernetes.cmd import status

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from oslo_config import cfg

View File

@ -14,8 +14,8 @@
# under the License.
from io import StringIO
from unittest import mock
import mock
from oslo_config import cfg
from oslo_serialization import jsonutils
import requests

View File

@ -12,8 +12,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 os
from unittest import mock
import uuid

View File

@ -13,10 +13,10 @@
from ctypes import c_bool
from kuryr_kubernetes.cni import health
from kuryr_kubernetes.tests import base
import mock
import multiprocessing
import os
import tempfile
from unittest import mock
from oslo_config import cfg

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from kuryr_kubernetes.cni import main
from kuryr_kubernetes.tests import base as test_base

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from oslo_serialization import jsonutils

View File

@ -14,8 +14,8 @@
# under the License.
import abc
from unittest import mock
import mock
from kuryr_kubernetes.controller.drivers import base as d_base
from kuryr_kubernetes.tests import base as test_base

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_config import cfg

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_config import cfg

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_config import cfg

View File

@ -12,9 +12,9 @@
# 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 munch
from openstack import exceptions as os_exc
from unittest import mock
from kuryr_kubernetes.controller.drivers import lb_public_ip\
as d_lb_public_ip

View File

@ -13,8 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import munch
from unittest import mock
from openstack import exceptions as os_exc
from openstack.load_balancer.v2 import listener as o_lis

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from kuryr_kubernetes import constants
from kuryr_kubernetes.controller.drivers import base as drivers

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
import munch
from openstack import exceptions as os_exc

View File

@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from unittest import mock
import ddt
import mock
from kuryr_kubernetes.controller.drivers import nested_dpdk_vif
from kuryr_kubernetes.tests import base as test_base

View File

@ -10,8 +10,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from unittest import mock
import ddt
import mock
import threading
from kuryr.lib import utils as lib_utils

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from kuryr.lib import exceptions as kl_exc
from oslo_config import cfg as oslo_cfg

View File

@ -10,8 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import munch
from unittest import mock
from kuryr.lib import constants as kl_const
from kuryr.lib import exceptions as kl_exc

View File

@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
import munch
from openstack import exceptions as os_exc
from unittest import mock
from kuryr_kubernetes.controller.drivers import network_policy
from kuryr_kubernetes import exceptions

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from kuryr_kubernetes.controller.drivers import network_policy_security_groups
from kuryr_kubernetes.tests import base as test_base

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from kuryr.lib import constants as kl_const
import munch

View File

@ -12,9 +12,9 @@
# 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 munch
from openstack import exceptions as os_exc
from unittest import mock
from kuryr_kubernetes.controller.drivers import public_ip\
as d_public_ip

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
import uuid
from kuryr_kubernetes.controller.drivers import sriov as drvs

View File

@ -11,7 +11,7 @@
# WITHOUT 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
from unittest import mock
from kuryr_kubernetes.controller.drivers import utils

View File

@ -13,7 +13,7 @@
# limitations under the License.
import collections
import mock
from unittest import mock
import uuid
import ddt

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from oslo_config import cfg as oslo_cfg

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from kuryr_kubernetes.controller.drivers import base as drivers
from kuryr_kubernetes.controller.drivers import namespace_subnet as subnet_drv

View File

@ -14,7 +14,7 @@
# under the License.
import itertools
import mock
from unittest import mock
import uuid
import os_vif.objects.network as osv_network

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from kuryr_kubernetes.controller.drivers import base as drivers
from kuryr_kubernetes.controller.handlers import namespace

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from kuryr_kubernetes.controller.handlers import pipeline as h_pipeline
from kuryr_kubernetes.handlers import dispatch as h_dis

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from kuryr_kubernetes import constants as k_const
from kuryr_kubernetes.controller.drivers import base as drivers

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from kuryr_kubernetes.controller.drivers import base as drivers
from kuryr_kubernetes.controller.handlers import policy

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from os_vif import objects as os_obj

View File

@ -16,7 +16,8 @@ from kuryr_kubernetes.controller.managers import health
from kuryr_kubernetes.handlers import health as h_health
from kuryr_kubernetes.tests import base
from kuryr_kubernetes.tests.unit import kuryr_fixtures as k_fix
import mock
from unittest import mock
from oslo_config import cfg as oslo_cfg

View File

@ -11,7 +11,7 @@
# WITHOUT 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
from unittest import mock
from http.server import BaseHTTPRequestHandler

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from kuryr_kubernetes.controller import service
from kuryr_kubernetes.tests import base as test_base

View File

@ -13,8 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import queue
from unittest import mock
from kuryr_kubernetes.handlers import asynchronous as h_async
from kuryr_kubernetes.tests import base as test_base

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from kuryr_kubernetes.handlers import dispatch as h_dis
from kuryr_kubernetes.tests import base as test_base

View File

@ -14,7 +14,7 @@
from kuryr_kubernetes.handlers import health as h_health
from kuryr_kubernetes.tests import base as test_base
import mock
from unittest import mock
class _TestHandler(h_health.HealthHandler):

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from kuryr_kubernetes.handlers import k8s_base as h_k8s
from kuryr_kubernetes.tests import base as test_base

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from kuryr_kubernetes.handlers import logging as h_log
from kuryr_kubernetes.tests import base as test_base

View File

@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from unittest import mock
import fixtures
import mock
import time
from kuryr_kubernetes import exceptions

View File

@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from unittest import mock
import fixtures
import mock
from kuryr_kubernetes import k8s_client

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from kuryr_kubernetes import clients
from kuryr_kubernetes.tests import base as test_base

View File

@ -13,9 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import itertools
import mock
import os
import tempfile
from unittest import mock
from oslo_serialization import jsonutils
import requests

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_concurrency import processutils as utils
from kuryr_kubernetes import linux_net_utils as linux_net

View File

@ -10,8 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from stevedore import extension
from unittest import mock
import os_vif
from os_vif import objects

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
import uuid
import munch

View File

@ -11,7 +11,7 @@
# WITHOUT 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
from unittest import mock
import munch
from openstack import exceptions as os_exc

View File

@ -14,7 +14,7 @@
# under the License.
from eventlet import greenlet
import mock
from unittest import mock
from kuryr_kubernetes.tests import base as test_base
from kuryr_kubernetes.tests.unit import kuryr_fixtures as kuryr_fixtures

View File

@ -7,7 +7,6 @@ hacking>=2.0.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
ddt>=1.0.1 # MIT
docutils>=0.11 # OSI-Approved Open Source, Public Domain
mock>=2.0.0 # BSD
python-subunit>=1.0.0 # Apache-2.0/BSD
stestr>=1.0.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0