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: I96263b774551821745a2345ffb2df3bf2a2dcf05 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
parent
8c7735d7ac
commit
5b6f800139
|
@ -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 saharaclient.osc import plugin
|
from saharaclient.osc import plugin
|
||||||
from saharaclient.tests.unit import base
|
from saharaclient.tests.unit import base
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
import mock
|
|
||||||
from osc_lib.tests import utils
|
from osc_lib.tests import utils
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
|
|
||||||
class TestDataProcessing(utils.TestCommand):
|
class TestDataProcessing(utils.TestCommand):
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
# 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 osc_lib.tests import utils as osc_utils
|
from osc_lib.tests import utils as osc_utils
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from saharaclient.api import cluster_templates as api_ct
|
from saharaclient.api import cluster_templates as api_ct
|
||||||
from saharaclient.api import clusters as api_cl
|
from saharaclient.api import clusters as api_cl
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
# 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 osc_lib.tests import utils as osc_utils
|
from osc_lib.tests import utils as osc_utils
|
||||||
import testtools
|
import testtools
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from saharaclient.api import data_sources as api_ds
|
from saharaclient.api import data_sources as api_ds
|
||||||
from saharaclient.osc.v1 import data_sources as osc_ds
|
from saharaclient.osc.v1 import data_sources as osc_ds
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
# 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 osc_lib.tests import utils as osc_utils
|
from osc_lib.tests import utils as osc_utils
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from saharaclient.api import images as api_images
|
from saharaclient.api import images as api_images
|
||||||
from saharaclient.osc.v1 import images as osc_images
|
from saharaclient.osc.v1 import images as osc_images
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
# 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 osc_lib.tests import utils as osc_u
|
from osc_lib.tests import utils as osc_u
|
||||||
import testtools
|
import testtools
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from saharaclient.api import job_binaries as api_jb
|
from saharaclient.api import job_binaries as api_jb
|
||||||
from saharaclient.osc.v1 import job_binaries as osc_jb
|
from saharaclient.osc.v1 import job_binaries as osc_jb
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
# 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 osc_lib.tests import utils as osc_utils
|
from osc_lib.tests import utils as osc_utils
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from saharaclient.api import jobs as api_j
|
from saharaclient.api import jobs as api_j
|
||||||
from saharaclient.osc.v1 import job_templates as osc_j
|
from saharaclient.osc.v1 import job_templates as osc_j
|
||||||
|
|
|
@ -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 saharaclient.api import job_types as api_jt
|
from saharaclient.api import job_types as api_jt
|
||||||
from saharaclient.api import jobs as api_j
|
from saharaclient.api import jobs as api_j
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
# 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 osc_lib.tests import utils as osc_utils
|
from osc_lib.tests import utils as osc_utils
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from saharaclient.api import job_executions as api_je
|
from saharaclient.api import job_executions as api_je
|
||||||
from saharaclient.osc.v1 import jobs as osc_je
|
from saharaclient.osc.v1 import jobs as osc_je
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
# 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 osc_lib.tests import utils as osc_utils
|
from osc_lib.tests import utils as osc_utils
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from saharaclient.api import node_group_templates as api_ngt
|
from saharaclient.api import node_group_templates as api_ngt
|
||||||
from saharaclient.osc.v1 import node_group_templates as osc_ngt
|
from saharaclient.osc.v1 import node_group_templates as osc_ngt
|
||||||
|
|
|
@ -13,7 +13,8 @@
|
||||||
# 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 oslo_serialization import jsonutils as json
|
from oslo_serialization import jsonutils as json
|
||||||
|
|
||||||
from saharaclient.api import plugins as api_plugins
|
from saharaclient.api import plugins as api_plugins
|
||||||
|
|
|
@ -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 saharaclient.osc import utils
|
from saharaclient.osc import utils
|
||||||
from saharaclient.tests.unit import base
|
from saharaclient.tests.unit import base
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
# 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 osc_lib.tests import utils as osc_utils
|
from osc_lib.tests import utils as osc_utils
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from saharaclient.api import cluster_templates as api_ct
|
from saharaclient.api import cluster_templates as api_ct
|
||||||
from saharaclient.api import clusters as api_cl
|
from saharaclient.api import clusters as api_cl
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
# 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 osc_lib.tests import utils as osc_utils
|
from osc_lib.tests import utils as osc_utils
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from saharaclient.api import data_sources as api_ds
|
from saharaclient.api import data_sources as api_ds
|
||||||
from saharaclient.osc.v1 import data_sources as osc_ds
|
from saharaclient.osc.v1 import data_sources as osc_ds
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
# 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 osc_lib.tests import utils as osc_utils
|
from osc_lib.tests import utils as osc_utils
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from saharaclient.api import images as api_images
|
from saharaclient.api import images as api_images
|
||||||
from saharaclient.osc.v1 import images as osc_images
|
from saharaclient.osc.v1 import images as osc_images
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
# 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 osc_lib.tests import utils as osc_u
|
from osc_lib.tests import utils as osc_u
|
||||||
import testtools
|
import testtools
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from saharaclient.api import job_binaries as api_jb
|
from saharaclient.api import job_binaries as api_jb
|
||||||
from saharaclient.osc.v1 import job_binaries as osc_jb
|
from saharaclient.osc.v1 import job_binaries as osc_jb
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
# 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 osc_lib.tests import utils as osc_utils
|
from osc_lib.tests import utils as osc_utils
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from saharaclient.api.v2 import job_templates as api_j
|
from saharaclient.api.v2 import job_templates as api_j
|
||||||
from saharaclient.osc.v2 import job_templates as osc_j
|
from saharaclient.osc.v2 import job_templates as osc_j
|
||||||
|
|
|
@ -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 saharaclient.api import job_types as api_jt
|
from saharaclient.api import job_types as api_jt
|
||||||
from saharaclient.api.v2 import job_templates as api_job_templates
|
from saharaclient.api.v2 import job_templates as api_job_templates
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
# 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 osc_lib.tests import utils as osc_utils
|
from osc_lib.tests import utils as osc_utils
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from saharaclient.api.v2 import jobs as api_j
|
from saharaclient.api.v2 import jobs as api_j
|
||||||
from saharaclient.osc.v2 import jobs as osc_j
|
from saharaclient.osc.v2 import jobs as osc_j
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
# 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 osc_lib.tests import utils as osc_utils
|
from osc_lib.tests import utils as osc_utils
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from saharaclient.api import node_group_templates as api_ngt
|
from saharaclient.api import node_group_templates as api_ngt
|
||||||
from saharaclient.osc.v2 import node_group_templates as osc_ngt
|
from saharaclient.osc.v2 import node_group_templates as osc_ngt
|
||||||
|
|
|
@ -13,7 +13,8 @@
|
||||||
# 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 oslo_serialization import jsonutils as json
|
from oslo_serialization import jsonutils as json
|
||||||
|
|
||||||
from saharaclient.api import plugins as api_plugins
|
from saharaclient.api import plugins as api_plugins
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
|
|
||||||
from saharaclient.api import data_sources as ds
|
from saharaclient.api import data_sources as ds
|
||||||
from saharaclient.tests.unit import base
|
from saharaclient.tests.unit import base
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import mock
|
|
||||||
from oslo_serialization import jsonutils as json
|
from oslo_serialization import jsonutils as json
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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 saharaclient.api import base
|
from saharaclient.api import base
|
||||||
from saharaclient.tests.unit import base as test_base
|
from saharaclient.tests.unit import base as test_base
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
hacking>=3.0,<3.1.0 # Apache-2.0
|
hacking>=3.0,<3.1.0 # Apache-2.0
|
||||||
|
|
||||||
coverage!=4.4,>=4.0 # Apache-2.0
|
coverage!=4.4,>=4.0 # Apache-2.0
|
||||||
mock>=2.0.0 # BSD
|
|
||||||
oslotest>=3.2.0 # Apache-2.0
|
oslotest>=3.2.0 # Apache-2.0
|
||||||
stestr>=1.0.0 # Apache-2.0
|
stestr>=1.0.0 # Apache-2.0
|
||||||
requests-mock>=1.2.0 # Apache-2.0
|
requests-mock>=1.2.0 # Apache-2.0
|
||||||
|
|
Loading…
Reference in New Issue