Browse Source

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>
changes/98/720998/1
Sean McGinnis 1 year ago
parent
commit
5b6f800139
No known key found for this signature in database GPG Key ID: CE7EE4BFAF8D70C8
  1. 2
      saharaclient/tests/unit/osc/test_plugin.py
  2. 2
      saharaclient/tests/unit/osc/v1/fakes.py
  3. 2
      saharaclient/tests/unit/osc/v1/test_clusters.py
  4. 2
      saharaclient/tests/unit/osc/v1/test_data_sources.py
  5. 2
      saharaclient/tests/unit/osc/v1/test_images.py
  6. 2
      saharaclient/tests/unit/osc/v1/test_job_binaries.py
  7. 2
      saharaclient/tests/unit/osc/v1/test_job_templates.py
  8. 2
      saharaclient/tests/unit/osc/v1/test_job_types.py
  9. 2
      saharaclient/tests/unit/osc/v1/test_jobs.py
  10. 2
      saharaclient/tests/unit/osc/v1/test_node_group_templates.py
  11. 3
      saharaclient/tests/unit/osc/v1/test_plugins.py
  12. 2
      saharaclient/tests/unit/osc/v1/test_utils.py
  13. 2
      saharaclient/tests/unit/osc/v2/test_clusters.py
  14. 2
      saharaclient/tests/unit/osc/v2/test_data_sources.py
  15. 2
      saharaclient/tests/unit/osc/v2/test_images.py
  16. 2
      saharaclient/tests/unit/osc/v2/test_job_binaries.py
  17. 2
      saharaclient/tests/unit/osc/v2/test_job_templates.py
  18. 2
      saharaclient/tests/unit/osc/v2/test_job_types.py
  19. 2
      saharaclient/tests/unit/osc/v2/test_jobs.py
  20. 2
      saharaclient/tests/unit/osc/v2/test_node_group_templates.py
  21. 3
      saharaclient/tests/unit/osc/v2/test_plugins.py
  22. 2
      saharaclient/tests/unit/test_data_sources.py
  23. 2
      saharaclient/tests/unit/test_manager.py
  24. 1
      test-requirements.txt

2
saharaclient/tests/unit/osc/test_plugin.py

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from saharaclient.osc import plugin
from saharaclient.tests.unit import base

2
saharaclient/tests/unit/osc/v1/fakes.py

@ -14,8 +14,8 @@
# limitations under the License.
import mock
from osc_lib.tests import utils
from unittest import mock
class TestDataProcessing(utils.TestCommand):

2
saharaclient/tests/unit/osc/v1/test_clusters.py

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
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 clusters as api_cl

2
saharaclient/tests/unit/osc/v1/test_data_sources.py

@ -13,9 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from osc_lib.tests import utils as osc_utils
import testtools
from unittest import mock
from saharaclient.api import data_sources as api_ds
from saharaclient.osc.v1 import data_sources as osc_ds

2
saharaclient/tests/unit/osc/v1/test_images.py

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from osc_lib.tests import utils as osc_utils
from unittest import mock
from saharaclient.api import images as api_images
from saharaclient.osc.v1 import images as osc_images

2
saharaclient/tests/unit/osc/v1/test_job_binaries.py

@ -13,9 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from osc_lib.tests import utils as osc_u
import testtools
from unittest import mock
from saharaclient.api import job_binaries as api_jb
from saharaclient.osc.v1 import job_binaries as osc_jb

2
saharaclient/tests/unit/osc/v1/test_job_templates.py

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from osc_lib.tests import utils as osc_utils
from unittest import mock
from saharaclient.api import jobs as api_j
from saharaclient.osc.v1 import job_templates as osc_j

2
saharaclient/tests/unit/osc/v1/test_job_types.py

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from saharaclient.api import job_types as api_jt
from saharaclient.api import jobs as api_j

2
saharaclient/tests/unit/osc/v1/test_jobs.py

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from osc_lib.tests import utils as osc_utils
from unittest import mock
from saharaclient.api import job_executions as api_je
from saharaclient.osc.v1 import jobs as osc_je

2
saharaclient/tests/unit/osc/v1/test_node_group_templates.py

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
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.osc.v1 import node_group_templates as osc_ngt

3
saharaclient/tests/unit/osc/v1/test_plugins.py

@ -13,7 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from oslo_serialization import jsonutils as json
from saharaclient.api import plugins as api_plugins

2
saharaclient/tests/unit/osc/v1/test_utils.py

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from saharaclient.osc import utils
from saharaclient.tests.unit import base

2
saharaclient/tests/unit/osc/v2/test_clusters.py

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
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 clusters as api_cl

2
saharaclient/tests/unit/osc/v2/test_data_sources.py

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from osc_lib.tests import utils as osc_utils
from unittest import mock
from saharaclient.api import data_sources as api_ds
from saharaclient.osc.v1 import data_sources as osc_ds

2
saharaclient/tests/unit/osc/v2/test_images.py

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from osc_lib.tests import utils as osc_utils
from unittest import mock
from saharaclient.api import images as api_images
from saharaclient.osc.v1 import images as osc_images

2
saharaclient/tests/unit/osc/v2/test_job_binaries.py

@ -13,9 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from osc_lib.tests import utils as osc_u
import testtools
from unittest import mock
from saharaclient.api import job_binaries as api_jb
from saharaclient.osc.v1 import job_binaries as osc_jb

2
saharaclient/tests/unit/osc/v2/test_job_templates.py

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
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.osc.v2 import job_templates as osc_j

2
saharaclient/tests/unit/osc/v2/test_job_types.py

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from saharaclient.api import job_types as api_jt
from saharaclient.api.v2 import job_templates as api_job_templates

2
saharaclient/tests/unit/osc/v2/test_jobs.py

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from osc_lib.tests import utils as osc_utils
from unittest import mock
from saharaclient.api.v2 import jobs as api_j
from saharaclient.osc.v2 import jobs as osc_j

2
saharaclient/tests/unit/osc/v2/test_node_group_templates.py

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
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.osc.v2 import node_group_templates as osc_ngt

3
saharaclient/tests/unit/osc/v2/test_plugins.py

@ -13,7 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from oslo_serialization import jsonutils as json
from saharaclient.api import plugins as api_plugins

2
saharaclient/tests/unit/test_data_sources.py

@ -14,8 +14,8 @@
from saharaclient.api import data_sources as ds
from saharaclient.tests.unit import base
from unittest import mock
import mock
from oslo_serialization import jsonutils as json

2
saharaclient/tests/unit/test_manager.py

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
from saharaclient.api import base
from saharaclient.tests.unit import base as test_base

1
test-requirements.txt

@ -5,7 +5,6 @@
hacking>=3.0,<3.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
mock>=2.0.0 # BSD
oslotest>=3.2.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0
requests-mock>=1.2.0 # Apache-2.0
Loading…
Cancel
Save