Merge "Use unittest.mock instead of third party mock"

This commit is contained in:
Zuul
2020-08-17 13:52:41 +00:00
committed by Gerrit Code Review
26 changed files with 27 additions and 36 deletions
+1 -1
View File
@@ -14,9 +14,9 @@
# under the License.
#
import decimal
from unittest import mock
from keystoneauth1 import session as ks_sess
import mock
from oslo_config import fixture as config_fixture
from oslotest import base
import testscenarios
@@ -13,8 +13,7 @@
# under the License.
#
import unittest
import mock
from unittest import mock
from cloudkitty.api.v2.dataframes import dataframes
from cloudkitty.utils import tz as tzutils
@@ -13,8 +13,7 @@
# under the License.
#
import unittest
import mock
from unittest import mock
from cloudkitty.api.v2.summary import summary
from cloudkitty.utils import tz as tzutils
+2 -1
View File
@@ -12,8 +12,9 @@
# License for the specific language governing permissions and limitations
# under the License.
#
from unittest import mock
import flask
import mock
import voluptuous
from werkzeug.datastructures import MultiDict
from werkzeug.exceptions import BadRequest
+1 -1
View File
@@ -14,9 +14,9 @@
# under the License.
#
import datetime
from unittest import mock
from dateutil import tz
import mock
from cloudkitty.collector import gnocchi
from cloudkitty import tests
+1 -2
View File
@@ -13,8 +13,7 @@
# under the License.
#
import datetime
import mock
from unittest import mock
from cloudkitty.collector import monasca as mon_collector
from cloudkitty import tests
@@ -14,8 +14,7 @@
# under the License.
#
from decimal import Decimal
import mock
from unittest import mock
from cloudkitty import collector
from cloudkitty.collector import exceptions
@@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
#
import mock
from unittest import mock
from cloudkitty.collector import prometheus
from cloudkitty import tests
+1 -1
View File
@@ -14,7 +14,7 @@
# under the License.
#
#
import mock
from unittest import mock
from cloudkitty.common.prometheus_client import PrometheusClient
from cloudkitty.common.prometheus_client import PrometheusResponseError
+1 -1
View File
@@ -18,10 +18,10 @@ import collections
import datetime
import decimal
import os
from unittest import mock
from dateutil import tz
from gabbi import fixture
import mock
from oslo_config import cfg
from oslo_config import fixture as conf_fixture
from oslo_db.sqlalchemy import utils
@@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
#
import mock
from unittest import mock
from gnocchiclient import exceptions as gexc
+1 -1
View File
@@ -15,8 +15,8 @@
#
import copy
import datetime
from unittest import mock
import mock
import testscenarios
from cloudkitty import storage
@@ -15,9 +15,9 @@
import collections
import datetime
import unittest
from unittest import mock
from dateutil import tz
import mock
from cloudkitty import dataframe
from cloudkitty.storage.v2.elasticsearch import client
+1 -1
View File
@@ -17,9 +17,9 @@ import copy
from datetime import datetime
from datetime import timedelta
import unittest
from unittest import mock
from dateutil import tz
import mock
from cloudkitty import dataframe
from cloudkitty.storage.v2 import influx
@@ -13,8 +13,8 @@
# under the License.
#
import datetime
from unittest import mock
import mock
import testscenarios
from cloudkitty import storage
+1 -1
View File
@@ -14,9 +14,9 @@
import sys
import textwrap
from unittest import mock
import ddt
import mock
import pep8
from cloudkitty.hacking import checks
+1 -1
View File
@@ -16,8 +16,8 @@
import copy
import datetime
import decimal
from unittest import mock
import mock
from oslo_utils import uuidutils
from cloudkitty import dataframe
+1 -1
View File
@@ -14,8 +14,8 @@
# under the License.
#
import unittest
from unittest import mock
import mock
from oslo_utils import uuidutils
from cloudkitty.fetcher import keystone
+1 -1
View File
@@ -14,8 +14,8 @@
# under the License.
#
import datetime
from unittest import mock
import mock
from oslo_messaging import conffixture
from stevedore import extension
from tooz import coordination
+1 -1
View File
@@ -16,9 +16,9 @@
import copy
import decimal
import hashlib
from unittest import mock
import zlib
import mock
from oslo_utils import uuidutils
import six
+1 -1
View File
@@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
#
import mock
from unittest import mock
from cloudkitty.db import api as ck_db_api
from cloudkitty import tests
+3 -7
View File
@@ -12,14 +12,10 @@
# License for the specific language governing permissions and limitations
# under the License.
#
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
from collections import abc
from datetime import datetime
import itertools
import mock
from unittest import mock
from cloudkitty import storage_state
from cloudkitty import tests
@@ -37,7 +33,7 @@ class StateManagerTest(tests.TestCase):
def __init__(self, output, *args, **kwargs):
super(StateManagerTest.QueryMock, self).__init__(*args, **kwargs)
self.first_called = 0
if not isinstance(output, Iterable):
if not isinstance(output, abc.Iterable):
output = (output, )
self.output = itertools.cycle(output)
+1 -1
View File
@@ -14,9 +14,9 @@
#
import datetime
import unittest
from unittest import mock
from dateutil import tz
import mock
from oslo_utils import timeutils
from cloudkitty import utils
+1 -1
View File
@@ -18,8 +18,8 @@ import decimal
import fractions
import itertools
import unittest
from unittest import mock
import mock
from oslo_utils import timeutils
from cloudkitty import utils as ck_utils
-1
View File
@@ -39,7 +39,6 @@ ddt==1.0.1 # MIT
gabbi==1.26.1 # Apache-2.0
testscenarios==0.4 # Apache-2.0/BSD
stestr==2.0.0 # Apache-2.0
mock==1.2 # BSD
sphinx==1.8.0 # BSD
openstackdocstheme==1.30.0 # Apache-2.0
oslotest==1.10.0 # Apache-2.0
-1
View File
@@ -11,7 +11,6 @@ ddt>=1.0.1 # MIT
gabbi>=1.26.1 # Apache-2.0
testscenarios>=0.4 # Apache-2.0/BSD
stestr>=2.0.0 # Apache-2.0
mock>=1.2 # BSD
sphinx>=1.8.0,!=2.1.0 # BSD
openstackdocstheme>=1.30.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0