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: I1dca4b2c7eccf1b19482dde60b88a132935b48b8 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
parent
17c9300570
commit
1d4e926076
@ -3,7 +3,6 @@
|
||||
# process, which may cause wedges in the gate later.
|
||||
hacking>=3.0,<3.1.0 # Apache-2.0
|
||||
bandit!=1.6.0,>=1.1.0 # Apache-2.0
|
||||
mock>=2.0.0 # BSD
|
||||
coverage!=4.4,>=4.0 # Apache-2.0
|
||||
oslotest>=3.2.0 # Apache-2.0
|
||||
prometheus_client
|
||||
|
@ -11,9 +11,9 @@
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
import mock
|
||||
import os
|
||||
import subprocess
|
||||
from unittest import mock
|
||||
import unittest
|
||||
|
||||
from monasca_agent.common import util
|
||||
|
@ -14,10 +14,10 @@
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
import mock
|
||||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
from unittest import mock
|
||||
import unittest
|
||||
|
||||
from cryptography import x509
|
||||
|
@ -11,7 +11,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
import unittest
|
||||
|
||||
import monasca_agent.common.util as util
|
||||
|
@ -12,9 +12,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from unittest import mock
|
||||
import unittest
|
||||
|
||||
import mock
|
||||
|
||||
import monasca_agent.collector.checks_d.ib_network as ib_network
|
||||
|
||||
|
@ -14,8 +14,8 @@
|
||||
|
||||
import os
|
||||
import logging
|
||||
from unittest import mock
|
||||
import unittest
|
||||
import mock
|
||||
import json
|
||||
import random
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
import unittest
|
||||
|
||||
from monasca_agent.collector.checks_d.kubernetes_api import KubernetesAPI
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
import unittest
|
||||
from collections import defaultdict
|
||||
from tempfile import mkdtemp
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
import unittest
|
||||
from collections import defaultdict
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslotest import base
|
||||
import psutil
|
||||
|
@ -11,7 +11,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
import unittest
|
||||
|
||||
from monasca_setup.detection.plugins.host_alive import HostAlive
|
||||
|
@ -12,9 +12,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from unittest import mock
|
||||
import unittest
|
||||
|
||||
import mock
|
||||
|
||||
import monasca_setup.detection.plugins.ib_network as ib_network
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslotest import base
|
||||
import psutil
|
||||
|
@ -12,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslotest import base
|
||||
import psutil
|
||||
|
@ -14,8 +14,8 @@
|
||||
|
||||
import logging
|
||||
import os
|
||||
from unittest import mock
|
||||
import unittest
|
||||
import mock
|
||||
import psutil
|
||||
import json
|
||||
import six
|
||||
|
@ -13,7 +13,7 @@
|
||||
# under the License.
|
||||
|
||||
from collections import namedtuple
|
||||
import mock
|
||||
from unittest import mock
|
||||
import unittest
|
||||
|
||||
from oslo_config import cfg
|
||||
|
@ -12,10 +12,10 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import random
|
||||
from unittest import mock
|
||||
import unittest
|
||||
|
||||
import logging
|
||||
import mock
|
||||
import psutil
|
||||
import six
|
||||
|
||||
|
@ -13,8 +13,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
from oslotest import base
|
||||
from oslo_config import cfg
|
||||
|
@ -12,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from oslotest import base
|
||||
import psutil
|
||||
|
@ -11,8 +11,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
import os.path
|
||||
from unittest import mock
|
||||
|
||||
import six
|
||||
import tempfile
|
||||
import unittest
|
||||
|
@ -12,8 +12,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
import random
|
||||
from unittest import mock
|
||||
|
||||
from oslotest import base
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
# under the License.
|
||||
|
||||
import collections
|
||||
import mock
|
||||
from unittest import mock
|
||||
import unittest
|
||||
|
||||
import monasca_setup
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
import unittest
|
||||
|
||||
from tests.common import load_check
|
||||
|
Loading…
x
Reference in New Issue
Block a user