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: I380f25044c8f7b496d485aabf09215468f955818 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
parent
74db147dc7
commit
db7377f476
@ -7,7 +7,6 @@ bandit!=1.6.0,>=1.1.0 # Apache-2.0
|
|||||||
Babel!=2.4.0,>=2.3.4 # BSD
|
Babel!=2.4.0,>=2.3.4 # BSD
|
||||||
hacking>=1.1.0,<1.2.0 # Apache-2.0
|
hacking>=1.1.0,<1.2.0 # Apache-2.0
|
||||||
coverage!=4.4,>=4.0 # Apache-2.0
|
coverage!=4.4,>=4.0 # Apache-2.0
|
||||||
mock>=2.0.0 # BSD
|
|
||||||
stestr>=1.0.0 # Apache-2.0
|
stestr>=1.0.0 # Apache-2.0
|
||||||
oslotest>=3.2.0 # Apache-2.0
|
oslotest>=3.2.0 # Apache-2.0
|
||||||
testrepository>=0.0.18 # Apache-2.0/BSD
|
testrepository>=0.0.18 # Apache-2.0/BSD
|
||||||
|
@ -12,8 +12,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import fixtures
|
import fixtures
|
||||||
import mock
|
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_config import fixture as oo_cfg
|
from oslo_config import fixture as oo_cfg
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
import collections
|
import collections
|
||||||
import json
|
import json
|
||||||
import mock
|
|
||||||
import time
|
import time
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from monasca_common.kafka import legacy_kafka_message
|
from monasca_common.kafka import legacy_kafka_message
|
||||||
|
|
||||||
|
@ -12,7 +12,8 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
import yaml
|
import yaml
|
||||||
|
@ -21,8 +21,8 @@ import email.header
|
|||||||
import smtplib
|
import smtplib
|
||||||
import socket
|
import socket
|
||||||
import time
|
import time
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import mock
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from monasca_notification.notification import Notification
|
from monasca_notification.notification import Notification
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
@ -10,7 +10,8 @@
|
|||||||
# or implied. See the License for the specific language governing permissions and limitations under
|
# or implied. See the License for the specific language governing permissions and limitations under
|
||||||
# the License.
|
# the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from monasca_notification import notification as m_notification
|
from monasca_notification import notification as m_notification
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
import pymysql
|
import pymysql
|
||||||
|
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
"""Tests NotificationProcessor"""
|
"""Tests NotificationProcessor"""
|
||||||
|
|
||||||
import mock
|
|
||||||
import time
|
import time
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from monasca_notification import notification as m_notification
|
from monasca_notification import notification as m_notification
|
||||||
from monasca_notification.plugins import email_notifier
|
from monasca_notification.plugins import email_notifier
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
import mock
|
|
||||||
import time
|
import time
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from monasca_notification import notification as m_notification
|
from monasca_notification import notification as m_notification
|
||||||
from monasca_notification.plugins import email_notifier
|
from monasca_notification.plugins import email_notifier
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
# or implied. See the License for the specific language governing permissions and limitations under
|
# or implied. See the License for the specific language governing permissions and limitations under
|
||||||
# the License.
|
# the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from monasca_notification.common.repositories.orm import orm_repo
|
from monasca_notification.common.repositories.orm import orm_repo
|
||||||
from tests import base
|
from tests import base
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import mock
|
|
||||||
import requests
|
import requests
|
||||||
import time
|
import time
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import mock
|
|
||||||
import requests
|
import requests
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import simplejson as json
|
import simplejson as json
|
||||||
import six
|
import six
|
||||||
|
Loading…
x
Reference in New Issue
Block a user