Browse Source

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: Ic767e59531bc2515cc1c20675792fe88300e3f30
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
changes/62/720962/2
Sean McGinnis 1 year ago
parent
commit
95cdf705a1
No known key found for this signature in database GPG Key ID: CE7EE4BFAF8D70C8
  1. 1
      lower-constraints.txt
  2. 4
      neutron_dynamic_routing/tests/unit/api/rpc/agentnotifiers/test_bgp_dr_rpc_agent_api.py
  3. 4
      neutron_dynamic_routing/tests/unit/api/rpc/handlers/test_bgp_speaker_rpc.py
  4. 2
      neutron_dynamic_routing/tests/unit/db/test_bgp_db.py
  5. 2
      neutron_dynamic_routing/tests/unit/services/bgp/agent/test_bgp_dragent.py
  6. 7
      neutron_dynamic_routing/tests/unit/services/bgp/driver/os_ken/test_driver.py
  7. 7
      neutron_dynamic_routing/tests/unit/services/bgp/scheduler/test_bgp_dragent_scheduler.py
  8. 2
      neutron_dynamic_routing/tests/unit/services/bgp/test_bgp_plugin.py
  9. 1
      test-requirements.txt

1
lower-constraints.txt

@ -45,7 +45,6 @@ logutils==0.3.5
Mako==0.4.0
MarkupSafe==1.0
mccabe==0.2.1
mock==2.0.0
monotonic==0.6
mox3==0.20.0
msgpack-python==0.4.0

4
neutron_dynamic_routing/tests/unit/api/rpc/agentnotifiers/test_bgp_dr_rpc_agent_api.py

@ -13,10 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from neutron_lib import context
from unittest import mock
from neutron.tests import base
from neutron_lib import context
from neutron_dynamic_routing.api.rpc.agentnotifiers import bgp_dr_rpc_agent_api

4
neutron_dynamic_routing/tests/unit/api/rpc/handlers/test_bgp_speaker_rpc.py

@ -13,10 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from neutron_lib.plugins import directory
from unittest import mock
from neutron.tests import base
from neutron_lib.plugins import directory
from neutron_dynamic_routing.api.rpc.handlers import bgp_speaker_rpc
from neutron_dynamic_routing.extensions import bgp as bgp_ext

2
neutron_dynamic_routing/tests/unit/db/test_bgp_db.py

@ -13,8 +13,8 @@
# under the License.
import contextlib
from unittest import mock
import mock
import netaddr
from neutron.db import l3_dvr_ha_scheduler_db
from neutron.tests.unit.extensions import test_l3

2
neutron_dynamic_routing/tests/unit/services/bgp/agent/test_bgp_dragent.py

@ -15,9 +15,9 @@
import copy
import sys
from unittest import mock
import eventlet
import mock
from neutron_lib import context
from oslo_config import cfg
from oslo_utils import uuidutils

7
neutron_dynamic_routing/tests/unit/services/bgp/driver/os_ken/test_driver.py

@ -13,15 +13,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import six
from unittest import mock
import mock
from neutron.tests import base
from os_ken.services.protocols.bgp import bgpspeaker
from os_ken.services.protocols.bgp.rtconf.neighbors import CONNECT_MODE_ACTIVE
from oslo_config import cfg
from oslo_utils import encodeutils
from neutron.tests import base
import six
from neutron_dynamic_routing.services.bgp.agent import config as bgp_config
from neutron_dynamic_routing.services.bgp.agent.driver import exceptions as bgp_driver_exc # noqa

7
neutron_dynamic_routing/tests/unit/services/bgp/scheduler/test_bgp_dragent_scheduler.py

@ -13,15 +13,14 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import testscenarios
from unittest import mock
from neutron.tests.unit import testlib_api
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib import context
from oslo_utils import importutils
from neutron.tests.unit import testlib_api
import testscenarios
from neutron_dynamic_routing.api.rpc.callbacks import resources as dr_resources
from neutron_dynamic_routing.db import bgp_db

2
neutron_dynamic_routing/tests/unit/services/bgp/test_bgp_plugin.py

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from neutron.tests import base
from neutron_lib.callbacks import events

1
test-requirements.txt

@ -6,7 +6,6 @@ hacking>=1.1.0,<1.2.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
flake8-import-order==0.12 # LGPLv3
mock>=2.0.0 # BSD
python-subunit>=1.0.0 # Apache-2.0/BSD
sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.5 # BSD
sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD

Loading…
Cancel
Save