Switch from mock to unittest.mock

We were relying on oslotest using the mock library and we were not
declaring it in our test-requirements.txt file, but now they are using
unittest.mock instead [1], so our unit tests are now failing because the
mock library is missing.

Switch to unittest.mock that is present in Python 3 to resolve the
problem.

[1]: https://review.opendev.org/#/c/715704/

Change-Id: If79500534aed2ab992c423f106088905edcb9d7f
This commit is contained in:
Gorka Eguileor 2020-04-01 18:18:48 +02:00
parent 18f85d8b25
commit 5ef9a57890
9 changed files with 12 additions and 9 deletions

View File

@ -14,8 +14,8 @@
# under the License.
import mock
import unittest
from unittest import mock
from oslo_config import cfg
import six

View File

@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from unittest import mock
import ddt
import mock
from cinderlib import exception
from cinderlib import objects

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from cinderlib import exception
from cinderlib import objects

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from cinder import objects as cinder_ovos

View File

@ -13,7 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from oslo_config import cfg
import cinderlib

View File

@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from unittest import mock
from cinder import objects as ovos
import mock
import cinderlib
from cinderlib import objects

View File

@ -15,9 +15,9 @@
import collections
import os
from unittest import mock
import ddt
import mock
from oslo_config import cfg
import cinderlib

View File

@ -14,9 +14,9 @@
# under the License.
import errno
from unittest import mock
import ddt
import mock
from os_brick import exception
from cinderlib import nos_brick

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
import cinderlib
from cinderlib.persistence import base