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: Idac937dd704ef11dfc33e197f7539e3f7a5feb92
This commit is contained in:
jacky06
2020-04-07 22:21:43 +08:00
parent ac0ccb67a6
commit 92c15fa38a
17 changed files with 26 additions and 19 deletions

View File

@@ -33,7 +33,6 @@ keystoneauth1==3.4.0
linecache2==1.0.0 linecache2==1.0.0
MarkupSafe==1.0 MarkupSafe==1.0
mccabe==0.2.1 mccabe==0.2.1
mock==2.0.0
monotonic==1.4 monotonic==1.4
mox3==0.20.0 mox3==0.20.0
msgpack-python==0.4.0 msgpack-python==0.4.0

View File

@@ -5,7 +5,6 @@
coverage!=4.4,>=4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD
hacking>=3.0,<3.1.0 # Apache-2.0 hacking>=3.0,<3.1.0 # Apache-2.0
mock>=2.0.0 # BSD
oslotest>=3.2.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0
python-subunit>=1.0.0 # Apache-2.0/BSD python-subunit>=1.0.0 # Apache-2.0/BSD
stestr>=2.0.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0

View File

@@ -13,7 +13,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 watcherclient.common import api_versioning from watcherclient.common import api_versioning
from watcherclient import exceptions from watcherclient import exceptions

View File

@@ -10,7 +10,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 keystoneauth1 import loading as kaloading from keystoneauth1 import loading as kaloading

View File

@@ -14,7 +14,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 watcherclient.common.apiclient import exceptions as exc from watcherclient.common.apiclient import exceptions as exc
from watcherclient.common import utils from watcherclient.common import utils

View File

@@ -15,9 +15,9 @@
import copy import copy
import os import os
from unittest import mock
import fixtures import fixtures
import mock
from oslo_utils import strutils from oslo_utils import strutils
import six import six
import testtools import testtools

View File

@@ -14,8 +14,8 @@
# limitations under the License. # limitations under the License.
import shlex import shlex
from unittest import mock
import mock
from osc_lib import utils as oscutils from osc_lib import utils as oscutils
from oslo_serialization import jsonutils from oslo_serialization import jsonutils

View File

@@ -14,7 +14,7 @@
# under the License. # under the License.
import copy import copy
import mock from unittest import mock
import testtools import testtools
from testtools import matchers from testtools import matchers

View File

@@ -14,10 +14,11 @@
# limitations under the License. # limitations under the License.
import datetime import datetime
import mock from unittest import mock
import six
from oslo_utils.uuidutils import generate_uuid from oslo_utils.uuidutils import generate_uuid
import six
from watcherclient import exceptions from watcherclient import exceptions
from watcherclient import shell from watcherclient import shell
from watcherclient.tests.unit.v1 import base from watcherclient.tests.unit.v1 import base

View File

@@ -14,7 +14,8 @@
# under the License. # under the License.
import datetime import datetime
import mock from unittest import mock
import six import six
from watcherclient import exceptions from watcherclient import exceptions

View File

@@ -14,7 +14,8 @@
# under the License. # under the License.
import datetime import datetime
import mock from unittest import mock
import six import six
from watcherclient import shell from watcherclient import shell

View File

@@ -14,7 +14,8 @@
# under the License. # under the License.
import datetime import datetime
import mock from unittest import mock
import six import six
from watcherclient import shell from watcherclient import shell

View File

@@ -12,7 +12,9 @@
# implied. # implied.
# 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 six import six
from watcherclient import shell from watcherclient import shell

View File

@@ -14,7 +14,8 @@
# limitations under the License. # limitations under the License.
import datetime import datetime
import mock from unittest import mock
import six import six
from watcherclient import shell from watcherclient import shell

View File

@@ -14,7 +14,8 @@
# limitations under the License. # limitations under the License.
import datetime import datetime
import mock from unittest import mock
import six import six
from watcherclient import shell from watcherclient import shell

View File

@@ -14,7 +14,8 @@
# limitations under the License. # limitations under the License.
import datetime import datetime
import mock from unittest import mock
import six import six
from watcherclient import shell from watcherclient import shell

View File

@@ -14,10 +14,10 @@
# limitations under the License. # limitations under the License.
import datetime import datetime
import mock from unittest import mock
import six
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
import six
from watcherclient import shell from watcherclient import shell
from watcherclient.tests.unit.v1 import base from watcherclient.tests.unit.v1 import base