Use unittest.mock instead of third party lib
mock was adopted into standard python in version 3.3 [1]. Since manila no longer supports python2.7, we can use the inbuilt mock package rather than the third party lib. Fix some issues with imports that weren't following our import conventions of grouping imports [3] Add a hacking test to ensure we don't regress on this. [1] https://docs.python.org/3/library/unittest.mock.html [2] http://lists.openstack.org/pipermail/openstack-discuss/2020-March/013281.html [3] https://docs.openstack.org/hacking/latest/user/hacking.html#imports Co-Authored-By: Sean McGinnis <sean.mcginnis@gmail.com> Change-Id: If857a49fbf526983e712282a25d7e8bef5093533 Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
This commit is contained in:
parent
9634bfa733
commit
598223985a
@ -19,8 +19,9 @@ Manila Specific Commandments
|
|||||||
- [M336] Must use a dict comprehension instead of a dict constructor
|
- [M336] Must use a dict comprehension instead of a dict constructor
|
||||||
with a sequence of key-value pairs.
|
with a sequence of key-value pairs.
|
||||||
- [M337] Ensure to not use xrange().
|
- [M337] Ensure to not use xrange().
|
||||||
- [M354] Use oslo_utils.uuidutils to generate UUID instead of uuid4().
|
|
||||||
- [M338] Ensure to not use LOG.warn().
|
- [M338] Ensure to not use LOG.warn().
|
||||||
|
- [M339] Ensure 'mock' is not imported/used. Use 'unittest.mock' instead.
|
||||||
|
- [M354] Use oslo_utils.uuidutils to generate UUID instead of uuid4().
|
||||||
- [M359] Validate that log messages are not translated.
|
- [M359] Validate that log messages are not translated.
|
||||||
|
|
||||||
LOG Translations
|
LOG Translations
|
||||||
|
@ -46,7 +46,6 @@ lxml==3.4.1
|
|||||||
Mako==1.0.7
|
Mako==1.0.7
|
||||||
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.25.0
|
mox3==0.25.0
|
||||||
msgpack==0.5.6
|
msgpack==0.5.6
|
||||||
|
@ -53,6 +53,8 @@ dict_constructor_with_list_copy_re = re.compile(r".*\bdict\((\[)?(\(|\[)")
|
|||||||
assert_no_xrange_re = re.compile(r"\s*xrange\s*\(")
|
assert_no_xrange_re = re.compile(r"\s*xrange\s*\(")
|
||||||
assert_True = re.compile(r".*assertEqual\(True, .*\)")
|
assert_True = re.compile(r".*assertEqual\(True, .*\)")
|
||||||
no_log_warn = re.compile(r"\s*LOG.warn\(.*")
|
no_log_warn = re.compile(r"\s*LOG.warn\(.*")
|
||||||
|
third_party_mock = re.compile(r"^import.mock")
|
||||||
|
from_third_party_mock = re.compile(r"^from.mock.import")
|
||||||
|
|
||||||
|
|
||||||
class BaseASTChecker(ast.NodeVisitor):
|
class BaseASTChecker(ast.NodeVisitor):
|
||||||
@ -333,3 +335,14 @@ def no_log_warn_check(logical_line):
|
|||||||
msg = ("M338: LOG.warn is deprecated, use LOG.warning.")
|
msg = ("M338: LOG.warn is deprecated, use LOG.warning.")
|
||||||
if re.match(no_log_warn, logical_line):
|
if re.match(no_log_warn, logical_line):
|
||||||
yield(0, msg)
|
yield(0, msg)
|
||||||
|
|
||||||
|
|
||||||
|
@core.flake8ext
|
||||||
|
def no_third_party_mock(logical_line):
|
||||||
|
# We should only use unittest.mock, not the third party mock library that
|
||||||
|
# was needed for py2 support.
|
||||||
|
if (re.match(third_party_mock, logical_line) or
|
||||||
|
re.match(from_third_party_mock, logical_line)):
|
||||||
|
msg = ('M339: Unit tests should use the standard library "mock" '
|
||||||
|
'module, not the third party mock library.')
|
||||||
|
yield(0, msg)
|
||||||
|
@ -23,9 +23,9 @@ inline callbacks.
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import fixtures
|
import fixtures
|
||||||
import mock
|
|
||||||
from oslo_concurrency import lockutils
|
from oslo_concurrency import lockutils
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_config import fixture as config_fixture
|
from oslo_config import fixture as config_fixture
|
||||||
|
@ -10,13 +10,13 @@
|
|||||||
# 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 inspect
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
import six
|
import six
|
||||||
import webob
|
import webob
|
||||||
|
|
||||||
import inspect
|
|
||||||
|
|
||||||
from manila.api.openstack import api_version_request as api_version
|
from manila.api.openstack import api_version_request as api_version
|
||||||
from manila.api.openstack import wsgi
|
from manila.api.openstack import wsgi
|
||||||
from manila import context
|
from manila import context
|
||||||
|
@ -17,8 +17,9 @@
|
|||||||
Test suites for 'common' code used throughout the OpenStack HTTP API.
|
Test suites for 'common' code used throughout the OpenStack HTTP API.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
import webob
|
import webob
|
||||||
import webob.exc
|
import webob.exc
|
||||||
|
|
||||||
|
@ -14,9 +14,10 @@
|
|||||||
# 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 ddt
|
import ddt
|
||||||
import iso8601
|
import iso8601
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
import webob
|
import webob
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
from oslo_utils import encodeutils
|
from oslo_utils import encodeutils
|
||||||
|
|
||||||
|
@ -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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_utils import uuidutils
|
from oslo_utils import uuidutils
|
||||||
from webob import exc
|
from webob import exc
|
||||||
|
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
import webob
|
import webob
|
||||||
|
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
import webob
|
import webob
|
||||||
|
|
||||||
from manila.api import common
|
from manila.api import common
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from webob import exc
|
from webob import exc
|
||||||
|
|
||||||
from manila.api.openstack import api_version_request as api_version
|
from manila.api.openstack import api_version_request as api_version
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
import six
|
import six
|
||||||
import webob
|
import webob
|
||||||
|
@ -15,8 +15,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_utils import strutils
|
from oslo_utils import strutils
|
||||||
import webob
|
import webob
|
||||||
|
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
import webob
|
import webob
|
||||||
|
|
||||||
from manila.api.v1 import share_unmanage
|
from manila.api.v1 import share_unmanage
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
|
|
||||||
import copy
|
import copy
|
||||||
import datetime
|
import datetime
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
import six
|
import six
|
||||||
|
@ -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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from manila.api.v2 import availability_zones
|
from manila.api.v2 import availability_zones
|
||||||
from manila import context
|
from manila import context
|
||||||
|
@ -10,9 +10,10 @@
|
|||||||
# 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 datetime
|
import datetime
|
||||||
import iso8601
|
import iso8601
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
import webob
|
import webob
|
||||||
|
|
||||||
|
@ -19,9 +19,9 @@ Tests for manila.api.v1.quota_class_sets.py
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
import webob.exc
|
import webob.exc
|
||||||
import webob.response
|
import webob.response
|
||||||
|
@ -18,8 +18,9 @@
|
|||||||
Tests for manila.api.v2.quota_sets.py
|
Tests for manila.api.v2.quota_sets.py
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
import webob.exc
|
import webob.exc
|
||||||
import webob.response
|
import webob.response
|
||||||
|
@ -12,9 +12,10 @@
|
|||||||
# 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 datetime
|
import datetime
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from manila.api.v1 import security_service
|
from manila.api.v1 import security_service
|
||||||
from manila.common import constants
|
from manila.common import constants
|
||||||
|
@ -16,9 +16,9 @@
|
|||||||
|
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
|
|
||||||
from manila.api.v2 import services
|
from manila.api.v2 import services
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
import webob
|
import webob
|
||||||
|
|
||||||
from manila.api.v2 import share_access_metadata
|
from manila.api.v2 import share_access_metadata
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from webob import exc
|
from webob import exc
|
||||||
|
|
||||||
from manila.api.v2 import share_accesses
|
from manila.api.v2 import share_accesses
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from webob import exc
|
from webob import exc
|
||||||
|
|
||||||
from manila.api.openstack import api_version_request as api_version
|
from manila.api.openstack import api_version_request as api_version
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
|
|
||||||
import copy
|
import copy
|
||||||
import datetime
|
import datetime
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
from oslo_utils import uuidutils
|
from oslo_utils import uuidutils
|
||||||
|
@ -10,8 +10,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_utils import strutils
|
from oslo_utils import strutils
|
||||||
import webob
|
import webob
|
||||||
|
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
|
|
||||||
import copy
|
import copy
|
||||||
import datetime
|
import datetime
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
import webob
|
import webob
|
||||||
|
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
|
|
||||||
import copy
|
import copy
|
||||||
import datetime
|
import datetime
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
from oslo_utils import uuidutils
|
from oslo_utils import uuidutils
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from webob import exc
|
from webob import exc
|
||||||
|
|
||||||
from manila.api.v2 import share_instance_export_locations as export_locations
|
from manila.api.v2 import share_instance_export_locations as export_locations
|
||||||
|
@ -10,8 +10,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
import six
|
import six
|
||||||
|
@ -14,8 +14,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_db import exception as db_exception
|
from oslo_db import exception as db_exception
|
||||||
|
|
||||||
from manila.api import common
|
from manila.api import common
|
||||||
|
@ -14,14 +14,15 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
from manila.api import common
|
|
||||||
import mock
|
|
||||||
from oslo_db import exception as db_exception
|
from oslo_db import exception as db_exception
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
from webob import exc as webob_exc
|
from webob import exc as webob_exc
|
||||||
|
|
||||||
|
from manila.api import common
|
||||||
from manila.api.openstack import api_version_request as api_version
|
from manila.api.openstack import api_version_request as api_version
|
||||||
from manila.api.v2 import share_networks
|
from manila.api.v2 import share_networks
|
||||||
from manila.db import api as db_api
|
from manila.db import api as db_api
|
||||||
|
@ -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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from webob import exc
|
from webob import exc
|
||||||
|
|
||||||
from manila.api.v2 import share_replica_export_locations as export_locations
|
from manila.api.v2 import share_replica_export_locations as export_locations
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
import six
|
import six
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
import webob
|
import webob
|
||||||
|
|
||||||
from manila.api.v2 import share_servers
|
from manila.api.v2 import share_servers
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from manila.api.v2 import share_snapshot_export_locations as export_locations
|
from manila.api.v2 import share_snapshot_export_locations as export_locations
|
||||||
from manila.common import constants
|
from manila.common import constants
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from manila.api.v2 import share_snapshot_instance_export_locations as exp_loc
|
from manila.api.v2 import share_snapshot_instance_export_locations as exp_loc
|
||||||
from manila.common import constants
|
from manila.common import constants
|
||||||
|
@ -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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
import six
|
import six
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
import six
|
import six
|
||||||
import webob
|
import webob
|
||||||
|
@ -14,12 +14,12 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
import random
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
import random
|
|
||||||
import webob
|
import webob
|
||||||
|
|
||||||
from manila.api.v2 import share_types as types
|
from manila.api.v2 import share_types as types
|
||||||
|
@ -16,9 +16,9 @@
|
|||||||
import copy
|
import copy
|
||||||
import datetime
|
import datetime
|
||||||
import itertools
|
import itertools
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
from oslo_utils import uuidutils
|
from oslo_utils import uuidutils
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from manila.api.openstack import api_version_request as api_version
|
from manila.api.openstack import api_version_request as api_version
|
||||||
from manila.api.views import share_accesses
|
from manila.api.views import share_accesses
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from manila.api.views import versions
|
from manila.api.views import versions
|
||||||
from manila import test
|
from manila import test
|
||||||
|
@ -16,9 +16,9 @@
|
|||||||
import code
|
import code
|
||||||
import readline
|
import readline
|
||||||
import sys
|
import sys
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from manila.cmd import share as manila_share
|
from manila.cmd import share as manila_share
|
||||||
from manila import test
|
from manila import test
|
||||||
|
@ -13,11 +13,11 @@
|
|||||||
# 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
|
||||||
|
|
||||||
from keystoneauth1 import loading as auth
|
from keystoneauth1 import loading as auth
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
import mock
|
|
||||||
|
|
||||||
from manila.common import client_auth
|
from manila.common import client_auth
|
||||||
from manila import exception
|
from manila import exception
|
||||||
from manila import test
|
from manila import test
|
||||||
|
@ -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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from novaclient import exceptions as nova_exception
|
from novaclient import exceptions as nova_exception
|
||||||
from novaclient import utils
|
from novaclient import utils
|
||||||
from novaclient.v2 import servers as nova_servers
|
from novaclient.v2 import servers as nova_servers
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from manila.common import constants
|
from manila.common import constants
|
||||||
from manila import context
|
from manila import context
|
||||||
|
@ -15,8 +15,10 @@
|
|||||||
"""
|
"""
|
||||||
Tests For Data Manager
|
Tests For Data Manager
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from manila.common import constants
|
from manila.common import constants
|
||||||
from manila import context
|
from manila import context
|
||||||
|
@ -17,8 +17,8 @@ Unit Tests for manila.data.rpcapi
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
|
|
||||||
|
@ -15,8 +15,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from manila.data import utils as data_utils
|
from manila.data import utils as data_utils
|
||||||
from manila import exception
|
from manila import exception
|
||||||
|
@ -17,8 +17,9 @@
|
|||||||
Tests for database migrations.
|
Tests for database migrations.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from alembic import script
|
from alembic import script
|
||||||
import mock
|
|
||||||
from oslo_db.sqlalchemy import test_base
|
from oslo_db.sqlalchemy import test_base
|
||||||
from oslo_db.sqlalchemy import test_migrations
|
from oslo_db.sqlalchemy import test_migrations
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
@ -19,10 +19,10 @@
|
|||||||
|
|
||||||
import copy
|
import copy
|
||||||
import datetime
|
import datetime
|
||||||
import ddt
|
|
||||||
import mock
|
|
||||||
import random
|
import random
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
|
import ddt
|
||||||
from oslo_db import exception as db_exception
|
from oslo_db import exception as db_exception
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
from oslo_utils import uuidutils
|
from oslo_utils import uuidutils
|
||||||
|
@ -13,8 +13,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 alembic
|
import alembic
|
||||||
import mock
|
|
||||||
|
|
||||||
from manila.db import migration
|
from manila.db import migration
|
||||||
from manila import test
|
from manila import test
|
||||||
|
@ -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 manila.tests import fake_compute
|
from manila.tests import fake_compute
|
||||||
|
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
"""This modules stubs out functions in manila.utils."""
|
"""This modules stubs out functions in manila.utils."""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from eventlet import greenthread
|
from eventlet import greenthread
|
||||||
import mock
|
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
@ -9,9 +9,10 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# 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 datetime
|
|
||||||
|
|
||||||
import mock
|
import datetime
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
|
|
||||||
|
@ -13,7 +13,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
|
||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from manila.network.linux import interface
|
from manila.network.linux import interface
|
||||||
|
@ -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 manila.network.linux import ip_lib
|
from manila.network.linux import ip_lib
|
||||||
from manila import test
|
from manila import test
|
||||||
|
@ -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 manila.network.linux import ovs_lib
|
from manila.network.linux import ovs_lib
|
||||||
from manila import test
|
from manila import test
|
||||||
|
@ -14,7 +14,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 neutronclient.common import exceptions as neutron_client_exc
|
from neutronclient.common import exceptions as neutron_client_exc
|
||||||
from neutronclient.v2_0 import client as clientv20
|
from neutronclient.v2_0 import client as clientv20
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import ddt
|
|
||||||
import mock
|
|
||||||
import time
|
import time
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
|
import ddt
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
from manila.common import constants
|
from manila.common import constants
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
import netaddr
|
import netaddr
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
import six
|
import six
|
||||||
|
@ -17,7 +17,8 @@
|
|||||||
Tests For Base Scheduler
|
Tests For Base Scheduler
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
|
|
||||||
|
@ -16,8 +16,9 @@
|
|||||||
Tests For Filter Scheduler.
|
Tests For Filter Scheduler.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_utils import strutils
|
from oslo_utils import strutils
|
||||||
|
|
||||||
from manila.common import constants
|
from manila.common import constants
|
||||||
|
@ -17,7 +17,8 @@
|
|||||||
Tests For Simple Scheduler
|
Tests For Simple Scheduler
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
from manila import context
|
from manila import context
|
||||||
|
@ -13,7 +13,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
|
||||||
|
|
||||||
from manila.scheduler.filters import base
|
from manila.scheduler.filters import base
|
||||||
from manila import test
|
from manila import test
|
||||||
|
@ -19,8 +19,9 @@ Tests For HostManager
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
from six import moves
|
from six import moves
|
||||||
|
@ -17,14 +17,10 @@
|
|||||||
Tests For Scheduler Manager
|
Tests For Scheduler Manager
|
||||||
"""
|
"""
|
||||||
|
|
||||||
try:
|
from importlib import reload
|
||||||
# Python3 variant
|
from unittest import mock
|
||||||
from importlib import reload
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
from manila.common import constants
|
from manila.common import constants
|
||||||
|
@ -17,8 +17,8 @@ Unit Tests for manila.scheduler.rpcapi
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
from manila import context
|
from manila import context
|
||||||
|
@ -16,8 +16,9 @@
|
|||||||
Tests For Capacity Weigher.
|
Tests For Capacity Weigher.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
from manila import context
|
from manila import context
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
Tests for Host Affinity Weigher.
|
Tests for Host Affinity Weigher.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from manila.common import constants
|
from manila.common import constants
|
||||||
from manila.db import api as db_api
|
from manila.db import api as db_api
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
Tests For Pool Weigher.
|
Tests For Pool Weigher.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
|
|
||||||
|
@ -13,12 +13,11 @@
|
|||||||
# 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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_utils import units
|
from oslo_utils import units
|
||||||
|
|
||||||
|
|
||||||
from manila.common import constants
|
from manila.common import constants
|
||||||
from manila import context
|
from manila import context
|
||||||
import manila.exception as exception
|
import manila.exception as exception
|
||||||
|
@ -14,10 +14,11 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
"""Unit tests for the Container helper module."""
|
"""Unit tests for the Container helper module."""
|
||||||
|
|
||||||
import ddt
|
from unittest import mock
|
||||||
import mock
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
import ddt
|
||||||
|
|
||||||
from manila import exception
|
from manila import exception
|
||||||
from manila.share import configuration
|
from manila.share import configuration
|
||||||
from manila.share.drivers.container import container_helper
|
from manila.share.drivers.container import container_helper
|
||||||
|
@ -14,9 +14,10 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
"""Unit tests for the Container driver module."""
|
"""Unit tests for the Container driver module."""
|
||||||
|
|
||||||
import ddt
|
|
||||||
import functools
|
import functools
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
|
import ddt
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
from manila.common import constants as const
|
from manila.common import constants as const
|
||||||
|
@ -14,9 +14,10 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
"""Unit tests for the Protocol helper module."""
|
"""Unit tests for the Protocol helper module."""
|
||||||
|
|
||||||
import ddt
|
|
||||||
import functools
|
import functools
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
|
import ddt
|
||||||
|
|
||||||
from manila.common import constants as const
|
from manila.common import constants as const
|
||||||
from manila import exception
|
from manila import exception
|
||||||
|
@ -13,9 +13,11 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
"""Unit tests for the Storage helper module."""
|
"""Unit tests for the Storage helper module."""
|
||||||
import ddt
|
|
||||||
import functools
|
import functools
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
|
import ddt
|
||||||
|
|
||||||
from manila import exception
|
from manila import exception
|
||||||
from manila.share import configuration
|
from manila.share import configuration
|
||||||
|
@ -13,7 +13,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_utils import units
|
from oslo_utils import units
|
||||||
|
|
||||||
from manila.common import constants as const
|
from manila.common import constants as const
|
||||||
|
@ -13,8 +13,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
|
||||||
|
|
||||||
from eventlet import greenthread
|
from eventlet import greenthread
|
||||||
import mock
|
|
||||||
from oslo_concurrency import processutils
|
from oslo_concurrency import processutils
|
||||||
from six.moves.urllib import error as url_error
|
from six.moves.urllib import error as url_error
|
||||||
from six.moves.urllib import request as url_request
|
from six.moves.urllib import request as url_request
|
||||||
|
@ -13,9 +13,10 @@
|
|||||||
# 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 ddt
|
|
||||||
import mock
|
|
||||||
import ssl
|
import ssl
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
|
import ddt
|
||||||
|
|
||||||
from manila.share.drivers.dell_emc.common.enas import utils
|
from manila.share.drivers.dell_emc.common.enas import utils
|
||||||
from manila import test
|
from manila import test
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import doctest
|
import doctest
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from lxml import doctestcompare
|
from lxml import doctestcompare
|
||||||
import mock
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
from oslo_utils import units
|
from oslo_utils import units
|
||||||
from requests.exceptions import HTTPError
|
from requests.exceptions import HTTPError
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from manila import exception
|
from manila import exception
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
from lxml import builder
|
from lxml import builder
|
||||||
import mock
|
|
||||||
from oslo_concurrency import processutils
|
from oslo_concurrency import processutils
|
||||||
|
|
||||||
from manila import exception
|
from manila import exception
|
||||||
|
@ -13,8 +13,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 sys
|
import sys
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
sys.modules['storops'] = mock.Mock()
|
sys.modules['storops'] = mock.Mock()
|
||||||
sys.modules['storops.unity'] = mock.Mock()
|
sys.modules['storops.unity'] = mock.Mock()
|
||||||
|
@ -13,7 +13,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_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
|
@ -13,8 +13,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 ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_utils import units
|
from oslo_utils import units
|
||||||
|
|
||||||
from manila import exception
|
from manila import exception
|
||||||
|
@ -14,8 +14,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_utils import units
|
from oslo_utils import units
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from os import path
|
from os import path
|
||||||
|
from unittest import mock
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
import mock
|
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from manila import exception
|
from manila import exception
|
||||||
|
@ -15,10 +15,11 @@
|
|||||||
|
|
||||||
import copy
|
import copy
|
||||||
import time
|
import time
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
from lxml import builder
|
from lxml import builder
|
||||||
import mock
|
|
||||||
|
|
||||||
from oslo_concurrency import processutils
|
from oslo_concurrency import processutils
|
||||||
|
|
||||||
|
@ -13,7 +13,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 stevedore import extension
|
from stevedore import extension
|
||||||
|
|
||||||
from manila.share import configuration as conf
|
from manila.share import configuration as conf
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
|
|
||||||
import copy
|
import copy
|
||||||
import re
|
import re
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from manila import exception
|
from manila import exception
|
||||||
from manila.share.drivers.ganesha import utils as ganesha_utils
|
from manila.share.drivers.ganesha import utils as ganesha_utils
|
||||||
|
@ -15,8 +15,9 @@
|
|||||||
|
|
||||||
"""Test cases for GlusterFS common routines."""
|
"""Test cases for GlusterFS common routines."""
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
from manila import exception
|
from manila import exception
|
||||||
|
@ -18,8 +18,9 @@
|
|||||||
Test cases for GlusterFS native protocol driver.
|
Test cases for GlusterFS native protocol driver.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
from manila.common import constants
|
from manila.common import constants
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
|
|
||||||
import errno
|
import errno
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
from manila import context
|
from manila import context
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user