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: Ib1f840f0cb778219f7640a2ca307847a090de6aa
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
tags/3.0.3^0
Sean McGinnis 3 months ago
parent
commit
ced4d8eae4
No known key found for this signature in database GPG Key ID: CE7EE4BFAF8D70C8
8 changed files with 12 additions and 8 deletions
  1. +0
    -1
      lower-constraints.txt
  2. +2
    -1
      oslo_policy/tests/test_checks.py
  3. +2
    -1
      oslo_policy/tests/test_external.py
  4. +1
    -1
      oslo_policy/tests/test_generator.py
  5. +2
    -1
      oslo_policy/tests/test_parser.py
  6. +1
    -1
      oslo_policy/tests/test_policy.py
  7. +2
    -1
      oslo_policy/tests/test_shell.py
  8. +2
    -1
      oslo_policy/tests/test_sphinxpolicygen.py

+ 0
- 1
lower-constraints.txt View File

@@ -19,7 +19,6 @@ keystoneauth1==3.4.0
linecache2==1.0.0
MarkupSafe==1.0
mccabe==0.2.1
mock==2.0.0
mox3==0.20.0
msgpack-python==0.4.0
netaddr==0.7.18


+ 2
- 1
oslo_policy/tests/test_checks.py View File

@@ -13,7 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.

import mock
from unittest import mock

from oslotest import base as test_base

from oslo_policy import _checks


+ 2
- 1
oslo_policy/tests/test_external.py View File

@@ -14,7 +14,8 @@
# under the License.

import json
import mock
from unittest import mock

from oslo_serialization import jsonutils
from requests_mock.contrib import fixture as rm_fixture
import six.moves.urllib.parse as urlparse


+ 1
- 1
oslo_policy/tests/test_generator.py View File

@@ -10,9 +10,9 @@
# under the License.

import operator
from unittest import mock
import warnings

import mock
from oslo_config import cfg
import stevedore
import testtools


+ 2
- 1
oslo_policy/tests/test_parser.py View File

@@ -13,7 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.

import mock
from unittest import mock

from oslotest import base as test_base
import six



+ 1
- 1
oslo_policy/tests/test_policy.py View File

@@ -16,8 +16,8 @@
"""Test of Policy Engine"""

import os
from unittest import mock

import mock
from oslo_config import cfg
from oslo_context import context
from oslo_serialization import jsonutils


+ 2
- 1
oslo_policy/tests/test_shell.py View File

@@ -14,7 +14,8 @@
# under the License.

import copy
import mock
from unittest import mock

from oslo_serialization import jsonutils

from oslo_policy import shell


+ 2
- 1
oslo_policy/tests/test_sphinxpolicygen.py View File

@@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.

import mock
from unittest import mock

from oslotest import base

from oslo_policy import sphinxpolicygen


Loading…
Cancel
Save