From 9dad727aefcbca647181fa88c38ebf4ac2801bd3 Mon Sep 17 00:00:00 2001 From: junboli <junbo85.li@gmail.com> Date: Mon, 7 May 2018 01:57:25 +0800 Subject: [PATCH] Fix failed to import test module The wrap @testtools.skipUnless cause the base class SnapshotAccessReadBase to be the <type 'function'>, However, it should be <type 'type'>, this cause the functional test unbale to import the test module. Closes-bug: #1769633 Change-Id: I98a296d009e64d6afab02a53bd1af878f78c4321 --- .../tests/functional/test_snapshot_access.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/manilaclient/tests/functional/test_snapshot_access.py b/manilaclient/tests/functional/test_snapshot_access.py index dc5d5c318..b53d9048f 100644 --- a/manilaclient/tests/functional/test_snapshot_access.py +++ b/manilaclient/tests/functional/test_snapshot_access.py @@ -22,9 +22,6 @@ from manilaclient.tests.functional import utils CONF = config.CONF -@testtools.skipUnless(CONF.run_snapshot_tests and - CONF.run_mount_snapshot_tests, - "Snapshots or mountable snapshots tests are disabled.") @utils.skip_if_microversion_not_supported('2.32') class SnapshotAccessReadBase(base.BaseTestCase): protocol = None @@ -146,22 +143,37 @@ class SnapshotAccessReadBase(base.BaseTestCase): snapshot['id'], 'cert', self.access_to['cert'][0]) +@testtools.skipUnless(CONF.run_snapshot_tests and + CONF.run_mount_snapshot_tests, + "Snapshots or mountable snapshots tests are disabled.") class NFSSnapshotAccessTest(SnapshotAccessReadBase): protocol = 'nfs' +@testtools.skipUnless(CONF.run_snapshot_tests and + CONF.run_mount_snapshot_tests, + "Snapshots or mountable snapshots tests are disabled.") class CIFSSnapshotAccessTest(SnapshotAccessReadBase): protocol = 'cifs' +@testtools.skipUnless(CONF.run_snapshot_tests and + CONF.run_mount_snapshot_tests, + "Snapshots or mountable snapshots tests are disabled.") class GlusterFSSnapshotAccessTest(SnapshotAccessReadBase): protocol = 'glusterfs' +@testtools.skipUnless(CONF.run_snapshot_tests and + CONF.run_mount_snapshot_tests, + "Snapshots or mountable snapshots tests are disabled.") class HDFSSnapshotAccessTest(SnapshotAccessReadBase): protocol = 'hdfs' +@testtools.skipUnless(CONF.run_snapshot_tests and + CONF.run_mount_snapshot_tests, + "Snapshots or mountable snapshots tests are disabled.") class MAPRFSSnapshotAccessTest(SnapshotAccessReadBase): protocol = 'maprfs'