Browse Source

Use standard library unittest.mock instead of mock

Use unittest.mock instead of mock.
Because mock became part of standard library
and available as unittest.mock since Python 3.6

Change-Id: Ibfe27316c20fa2c8935b559fed7885a6e194d314
changes/22/823922/2
vanou 4 months ago committed by Vanou Ishii
parent
commit
435484df1b
  1. 3
      scciclient/tests/irmc/test_elcm.py
  2. 3
      scciclient/tests/irmc/test_ipmi.py
  3. 2
      scciclient/tests/irmc/test_scci.py
  4. 2
      scciclient/tests/irmc/test_snmp.py
  5. 3
      scciclient/tests/irmc/viom/test_client.py
  6. 2
      scciclient/tests/irmc/viom/test_elcm.py
  7. 1
      test-requirements.txt

3
scciclient/tests/irmc/test_elcm.py

@ -16,7 +16,8 @@
Test class for iRMC eLCM functionality.
"""
import mock
from unittest import mock
from oslo_utils import encodeutils
import requests
from requests_mock.contrib import fixture as rm_fixture

3
scciclient/tests/irmc/test_ipmi.py

@ -15,7 +15,8 @@
Test class for IPMI Module.
"""
import mock
from unittest import mock
from pyghmi import exceptions as ipmi_exception
from pyghmi.ipmi import command as ipmi_command
import testtools

2
scciclient/tests/irmc/test_scci.py

@ -17,10 +17,10 @@ Test class for iRMC Power Driver
import os
import time
from unittest import mock
import xml.etree.ElementTree as ET
import defusedxml.ElementTree as dET
import mock
from requests_mock.contrib import fixture as rm_fixture
import six
import six.moves.builtins as __builtin__

2
scciclient/tests/irmc/test_snmp.py

@ -15,8 +15,8 @@
Test class for snmp module.
"""
from unittest import mock
import mock
from pysnmp.entity.rfc3413.oneliner import cmdgen
from pysnmp import error as snmp_error
import testtools

3
scciclient/tests/irmc/viom/test_client.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 scciclient.irmc import scci

2
scciclient/tests/irmc/viom/test_elcm.py

@ -17,8 +17,8 @@ Test class for iRMC eLCM functionality.
"""
import time
from unittest import mock
import mock
import testtools
from scciclient.irmc import elcm

1
test-requirements.txt

@ -4,7 +4,6 @@
coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
mock>=2.0.0 # BSD
python-subunit>=1.0.0 # Apache-2.0/BSD
oslotest>=3.2.0,<4;python_version<'3.6' # Apache-2.0
oslotest>=3.2.0;python_version>='3.6' # Apache-2.0

Loading…
Cancel
Save