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: I5ad2c7a44dee2e19ab2576f206c69d94126a22b1
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Co-Authored-By: zhurong <aaronzhu1121@gmail.com>
This commit is contained in:
Sean McGinnis 2020-04-18 11:55:19 -05:00 committed by zhurong
parent a09aed6beb
commit 22efa8fd7f
27 changed files with 28 additions and 29 deletions

View File

@ -31,7 +31,7 @@ fixtures==3.0.0
flake8==2.5.5 flake8==2.5.5
futurist==1.6.0 futurist==1.6.0
hacking==0.12.0 hacking==0.12.0
horizon==17.1.0 horizon==18.3.0
idna==2.6 idna==2.6
imagesize==1.0.0 imagesize==1.0.0
iso8601==0.1.11 iso8601==0.1.11
@ -135,7 +135,7 @@ XStatic-jquery-ui==1.12.0.1
XStatic-JQuery.quicksearch==2.0.3.1 XStatic-JQuery.quicksearch==2.0.3.1
XStatic-JQuery.TableSorter==2.14.5.1 XStatic-JQuery.TableSorter==2.14.5.1
XStatic-JSEncrypt==2.3.1.1 XStatic-JSEncrypt==2.3.1.1
XStatic-mdi==1.4.57.0 XStatic-mdi==1.6.50.2
XStatic-objectpath==1.2.1.0 XStatic-objectpath==1.2.1.0
XStatic-Rickshaw==1.5.0.0 XStatic-Rickshaw==1.5.0.0
XStatic-roboto-fontface==0.5.0.0 XStatic-roboto-fontface==0.5.0.0

View File

@ -13,12 +13,11 @@
# under the License. # under the License.
from django.core import exceptions from django.core import exceptions
from unittest import mock
from muranodashboard.dynamic_ui import fields from muranodashboard.dynamic_ui import fields
from openstack_dashboard.test import helpers from openstack_dashboard.test import helpers
import mock
class FlavorFlave(object): class FlavorFlave(object):
def __init__(self, id, name, vcpus, disk, ram): def __init__(self, id, name, vcpus, disk, ram):

View File

@ -12,7 +12,7 @@
# 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 muranodashboard.catalog import tabs from muranodashboard.catalog import tabs
from openstack_dashboard.test import helpers from openstack_dashboard.test import helpers

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import collections import collections
import mock
import unittest import unittest
from unittest import mock
from django.conf import settings from django.conf import settings
from django.forms import formsets from django.forms import formsets

View File

@ -12,8 +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
import unittest import unittest
from unittest import mock
from muranodashboard.categories import tables from muranodashboard.categories import tables
from muranodashboard.categories import views from muranodashboard.categories import views

View File

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

View File

@ -16,8 +16,8 @@ try:
import cPickle as pickle import cPickle as pickle
except ImportError: except ImportError:
import pickle import pickle
from unittest import mock
import mock
import unittest import unittest
import yaql import yaql

View File

@ -16,8 +16,8 @@ from django.core import exceptions
from django.core import validators as django_validator from django.core import validators as django_validator
from django import forms from django import forms
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from unittest import mock
import mock
import unittest import unittest
from muranodashboard.dynamic_ui import fields from muranodashboard.dynamic_ui import fields

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import collections import collections
import mock
import unittest import unittest
from unittest import mock
from yaql.language import contexts as yaql_contexts from yaql.language import contexts as yaql_contexts
from django import forms as django_forms from django import forms as django_forms

View File

@ -15,8 +15,8 @@
import collections import collections
from django import forms from django import forms
import mock
import semantic_version import semantic_version
from unittest import mock
from yaql.language import factory from yaql.language import factory
from muranodashboard.catalog import forms as catalog_forms from muranodashboard.catalog import forms as catalog_forms

View File

@ -12,9 +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.
import mock
import re import re
import unittest import unittest
from unittest import mock
from castellan.common import exception as castellan_exception from castellan.common import exception as castellan_exception
from castellan.common.objects import opaque_data from castellan.common.objects import opaque_data

View File

@ -12,7 +12,7 @@
# 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 muranoclient.common import exceptions as exc from muranoclient.common import exceptions as exc
from muranoclient.v1 import client from muranoclient.v1 import client

View File

@ -12,8 +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
import unittest import unittest
from unittest import mock
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _

View File

@ -13,7 +13,7 @@
# under the License. # under the License.
from django import http from django import http
import mock from unittest import mock
from muranodashboard.api.rest import environments from muranodashboard.api.rest import environments

View File

@ -14,8 +14,8 @@
import ast import ast
from django import http as django_http from django import http as django_http
import mock
import unittest import unittest
from unittest import mock
from horizon import tables as hz_tables from horizon import tables as hz_tables

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import collections import collections
import mock
import unittest import unittest
from unittest import mock
from django.conf import settings from django.conf import settings
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _

View File

@ -13,7 +13,7 @@
# under the License. # under the License.
import json import json
import mock from unittest import mock
from muranodashboard.environments import consts from muranodashboard.environments import consts
from muranodashboard.environments import topology from muranodashboard.environments import topology

View File

@ -16,9 +16,9 @@ import base64
from django.conf import settings from django.conf import settings
from django import http from django import http
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import mock
import sys import sys
import unittest import unittest
from unittest import mock
from horizon import conf from horizon import conf

View File

@ -12,8 +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
import unittest import unittest
from unittest import mock
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
import json import json
import mock
import unittest import unittest
from unittest import mock
from horizon import exceptions from horizon import exceptions

View File

@ -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 six import PY3 from six import PY3
from muranoclient.v1 import client from muranoclient.v1 import client

View File

@ -12,7 +12,7 @@
# 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 django import forms as django_forms from django import forms as django_forms

View File

@ -12,8 +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
import unittest import unittest
from unittest import mock
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _

View File

@ -15,8 +15,8 @@
from django.core.files import storage from django.core.files import storage
from django import http from django import http
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from unittest import mock
import mock
from horizon import exceptions as horizon_exceptions from horizon import exceptions as horizon_exceptions
from muranoclient.common import exceptions as exc from muranoclient.common import exceptions as exc

View File

@ -13,7 +13,7 @@
# under the License. # under the License.
import mock from unittest import mock
from django.conf import settings from django.conf import settings

View File

@ -15,4 +15,4 @@ castellan>=0.18.0 # Apache-2.0
oslo.log>=3.36.0 # Apache-2.0 oslo.log>=3.36.0 # Apache-2.0
semantic-version>=2.3.1 # BSD semantic-version>=2.3.1 # BSD
horizon>=17.1.0 # Apache-2.0 horizon>=18.3.0 # Apache-2.0

View File

@ -9,7 +9,6 @@ coverage!=4.4,>=4.0 # Apache-2.0
oslo.config>=5.2.0 # Apache-2.0 oslo.config>=5.2.0 # Apache-2.0
selenium>=2.50.1 # Apache-2.0 selenium>=2.50.1 # Apache-2.0
mock>=2.0.0 # BSD
# Docs Requirements # Docs Requirements
openstackdocstheme>=1.20.0 # Apache-2.0 openstackdocstheme>=1.20.0 # Apache-2.0