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: Ida2ec7793c3863836e1c626eb72e0aa9f48b6810 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
parent
46045d407c
commit
4b08096d23
@ -12,12 +12,11 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
|
||||||
from smtplib import SMTPException
|
from smtplib import SMTPException
|
||||||
|
from unittest import mock
|
||||||
from django.core import mail
|
|
||||||
|
|
||||||
from confspirator.tests import utils as conf_utils
|
from confspirator.tests import utils as conf_utils
|
||||||
|
from django.core import mail
|
||||||
|
|
||||||
from adjutant.actions.v1.misc import SendAdditionalEmailAction
|
from adjutant.actions.v1.misc import SendAdditionalEmailAction
|
||||||
from adjutant.actions.utils import send_email
|
from adjutant.actions.utils import send_email
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from confspirator.tests import utils as conf_utils
|
from confspirator.tests import utils as conf_utils
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from confspirator.tests import utils as conf_utils
|
from confspirator.tests import utils as conf_utils
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from confspirator.tests import utils as conf_utils
|
from confspirator.tests import utils as conf_utils
|
||||||
|
|
||||||
|
@ -14,17 +14,15 @@
|
|||||||
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import json
|
import json
|
||||||
import mock
|
from unittest import mock
|
||||||
from unittest import skip
|
from unittest import skip
|
||||||
|
|
||||||
|
from confspirator.tests import utils as conf_utils
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.core import mail
|
from django.core import mail
|
||||||
|
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
from rest_framework.test import APITestCase
|
from rest_framework.test import APITestCase
|
||||||
|
|
||||||
from confspirator.tests import utils as conf_utils
|
|
||||||
|
|
||||||
from adjutant.api.models import Task, Token, Notification
|
from adjutant.api.models import Task, Token, Notification
|
||||||
from adjutant.common.tests import fake_clients
|
from adjutant.common.tests import fake_clients
|
||||||
from adjutant.common.tests.fake_clients import FakeManager, setup_identity_cache
|
from adjutant.common.tests.fake_clients import FakeManager, setup_identity_cache
|
||||||
|
@ -13,13 +13,11 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from rest_framework import status
|
|
||||||
|
|
||||||
from django.utils import timezone
|
|
||||||
|
|
||||||
from confspirator.tests import utils as conf_utils
|
from confspirator.tests import utils as conf_utils
|
||||||
|
from django.utils import timezone
|
||||||
|
from rest_framework import status
|
||||||
|
|
||||||
from adjutant.api.models import Token, Task
|
from adjutant.api.models import Token, Task
|
||||||
from adjutant.common.tests import fake_clients
|
from adjutant.common.tests import fake_clients
|
||||||
|
@ -12,13 +12,11 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from django.core import mail
|
|
||||||
|
|
||||||
from rest_framework import status
|
|
||||||
|
|
||||||
from confspirator.tests import utils as conf_utils
|
from confspirator.tests import utils as conf_utils
|
||||||
|
from django.core import mail
|
||||||
|
from rest_framework import status
|
||||||
|
|
||||||
from adjutant.api.models import Token, Notification
|
from adjutant.api.models import Token, Notification
|
||||||
from adjutant.tasks.models import Task
|
from adjutant.tasks.models import Task
|
||||||
|
@ -12,10 +12,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
import mock
|
|
||||||
|
|
||||||
from adjutant.config import CONF
|
from adjutant.config import CONF
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,13 +12,11 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from django.core import mail
|
|
||||||
|
|
||||||
from rest_framework import status
|
|
||||||
|
|
||||||
from confspirator.tests import utils as conf_utils
|
from confspirator.tests import utils as conf_utils
|
||||||
|
from django.core import mail
|
||||||
|
from rest_framework import status
|
||||||
|
|
||||||
from adjutant.api.models import Notification
|
from adjutant.api.models import Notification
|
||||||
from adjutant.tasks.models import Task
|
from adjutant.tasks.models import Task
|
||||||
|
@ -6,7 +6,6 @@ flake8>=3.7.7 # MIT
|
|||||||
|
|
||||||
coverage>=4.5.3 # Apache-2.0
|
coverage>=4.5.3 # Apache-2.0
|
||||||
doc8>=0.8.0 # Apache-2.0
|
doc8>=0.8.0 # Apache-2.0
|
||||||
mock>=3.0.0 # BSD
|
|
||||||
Pygments>=2.2.0 # BSD license
|
Pygments>=2.2.0 # BSD license
|
||||||
flake8-bugbear>=19.3.0;python_version>='3.4' # MIT
|
flake8-bugbear>=19.3.0;python_version>='3.4' # MIT
|
||||||
black>=19.3b0;python_version>='3.4' # MIT
|
black>=19.3b0;python_version>='3.4' # MIT
|
||||||
|
Loading…
Reference in New Issue
Block a user