Allow mox-free horizon plugins to consume horizon test helper
horizon test helpers now depend on mox3. This prevents horizon plugins from consuming the test helpers even if a plugin itself is mox free. This commit makes mox import optional. Change-Id: I631518d8f4cd9641920f68cd1e405298ddb7965a Closes-Bug: #1753555
This commit is contained in:
parent
d4c1c29cbb
commit
fb9ef26a7b
|
@ -55,8 +55,14 @@ except ImportError as e:
|
|||
LOG.warning("%s, force WITH_SELENIUM=False", e)
|
||||
os.environ['WITH_SELENIUM'] = ''
|
||||
|
||||
|
||||
from mox3 import mox
|
||||
# As of Rocky, we are in the process of removing mox usage.
|
||||
# To allow mox-free horizon plugins to consume the test helper,
|
||||
# mox import is now optional. If tests depends on mox,
|
||||
# mox (or mox3) must be declared in test-requirements.txt.
|
||||
try:
|
||||
from mox3 import mox
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
from horizon import middleware
|
||||
|
||||
|
|
|
@ -38,8 +38,15 @@ from django.utils import http
|
|||
from cinderclient import client as cinder_client
|
||||
import glanceclient
|
||||
from keystoneclient.v2_0 import client as keystone_client
|
||||
# As of Rocky, we are in the process of removing mox usage.
|
||||
# To allow mox-free horizon plugins to consume the test helper,
|
||||
# mox import is now optional. If tests depends on mox,
|
||||
# mox (or mox3) must be declared in test-requirements.txt.
|
||||
import mock
|
||||
from mox3 import mox
|
||||
try:
|
||||
from mox3 import mox
|
||||
except ImportError:
|
||||
pass
|
||||
from neutronclient.v2_0 import client as neutron_client
|
||||
from novaclient import api_versions as nova_api_versions
|
||||
from novaclient.v2 import client as nova_client
|
||||
|
|
Loading…
Reference in New Issue