Merge "Use unittest.mock instead of mock"

This commit is contained in:
Zuul 2020-07-13 05:53:33 +00:00 committed by Gerrit Code Review
commit 060f202af4
10 changed files with 10 additions and 11 deletions

View File

@ -9,7 +9,6 @@
#
charm-tools>=2.4.4
requests>=2.18.4
mock>=1.2
flake8>=2.2.4,<=2.4.1
stestr>=2.2.0
coverage>=4.5.2

View File

@ -18,12 +18,12 @@ import sys
import tempfile
import unittest
import mock
from unittest import mock
import yaml
from unit_tests.test_utils import CharmTestCase
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
# python-apt is not installed as part of test-requirements but is imported by
# some charmhelpers modules so create a fake import.

View File

@ -15,7 +15,7 @@
import os
import sys
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
os.environ['JUJU_UNIT_NAME'] = 'swift-storage'

View File

@ -17,7 +17,7 @@ import sys
import unittest
import urllib
from mock import (
from unittest.mock import (
patch,
mock_open,
MagicMock,

View File

@ -17,7 +17,7 @@ import tempfile
import unittest
import shutil
from mock import patch
from unittest.mock import patch
from lib.misc_utils import ensure_block_device

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from mock import MagicMock
from unittest.mock import MagicMock
from unit_tests.test_utils import CharmTestCase, patch_open

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from mock import patch
from unittest.mock import patch
import json
import os
import tempfile

View File

@ -13,7 +13,7 @@
# limitations under the License.
from collections import namedtuple
from mock import call, patch, MagicMock
from unittest.mock import call, patch, MagicMock
import shutil
import tempfile

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import mock
from unittest import mock
import unittest
from jinja2 import Environment

View File

@ -19,7 +19,7 @@ import unittest
import yaml
from contextlib import contextmanager
from mock import MagicMock, patch
from unittest.mock import MagicMock, patch
def load_config():