Merge "Refactored the way how testscenarios tests are run"
This commit is contained in:
@@ -21,15 +21,12 @@
|
||||
import datetime
|
||||
|
||||
import mock
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.openstack.common import timeutils
|
||||
from ceilometer.storage import models
|
||||
from ceilometer.tests import api as tests_api
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class TestComputeDurationByResource(tests_api.TestBase,
|
||||
tests_db.MixinTestsWithBackendScenarios):
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.publisher import utils
|
||||
from ceilometer import sample
|
||||
@@ -28,8 +27,6 @@ from ceilometer import sample
|
||||
from ceilometer.tests import api as tests_api
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class TestListEvents(tests_api.TestBase,
|
||||
tests_db.MixinTestsWithBackendScenarios):
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.publisher import utils
|
||||
from ceilometer import sample
|
||||
@@ -29,8 +28,6 @@ from ceilometer import sample
|
||||
from ceilometer.tests import api as tests_api
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.publisher import utils
|
||||
from ceilometer import sample
|
||||
@@ -29,8 +28,6 @@ from ceilometer import sample
|
||||
from ceilometer.tests import api as tests_api
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.publisher import utils
|
||||
from ceilometer import sample
|
||||
@@ -29,8 +28,6 @@ from ceilometer import sample
|
||||
from ceilometer.tests import api as tests_api
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -17,13 +17,9 @@
|
||||
# under the License.
|
||||
"""Test listing users.
|
||||
"""
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.tests import api as tests_api
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class TestListSource(tests_api.TestBase,
|
||||
tests_db.MixinTestsWithBackendScenarios):
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.publisher import utils
|
||||
from ceilometer import sample
|
||||
@@ -29,8 +28,6 @@ from ceilometer import sample
|
||||
from ceilometer.tests import api as tests_api
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.publisher import utils
|
||||
from ceilometer import sample
|
||||
@@ -28,8 +27,6 @@ from ceilometer import sample
|
||||
from ceilometer.tests import api as tests_api
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class TestMaxProjectVolume(tests_api.TestBase,
|
||||
tests_db.MixinTestsWithBackendScenarios):
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.publisher import utils
|
||||
from ceilometer import sample
|
||||
@@ -27,8 +26,6 @@ from ceilometer import sample
|
||||
from ceilometer.tests import api as tests_api
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class TestMaxResourceVolume(tests_api.TestBase,
|
||||
tests_db.MixinTestsWithBackendScenarios):
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.publisher import utils
|
||||
from ceilometer import sample
|
||||
@@ -28,8 +27,6 @@ from ceilometer import sample
|
||||
from ceilometer.tests import api as tests_api
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class TestSumProjectVolume(tests_api.TestBase,
|
||||
tests_db.MixinTestsWithBackendScenarios):
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.publisher import utils
|
||||
from ceilometer import sample
|
||||
@@ -28,8 +27,6 @@ from ceilometer import sample
|
||||
from ceilometer.tests import api as tests_api
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class TestSumResourceVolume(tests_api.TestBase,
|
||||
tests_db.MixinTestsWithBackendScenarios):
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
import datetime
|
||||
import json
|
||||
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.api import acl
|
||||
from ceilometer.api.controllers import v2 as v2_api
|
||||
from ceilometer.openstack.common import timeutils
|
||||
@@ -30,9 +28,6 @@ from ceilometer import sample
|
||||
from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
VALID_TOKEN = '4562138218392831'
|
||||
VALID_TOKEN2 = '4562138218392832'
|
||||
|
||||
|
||||
@@ -28,15 +28,12 @@ import uuid
|
||||
import mock
|
||||
|
||||
from six import moves
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.storage import models
|
||||
from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.openstack.common import timeutils
|
||||
from ceilometer.publisher import utils
|
||||
@@ -30,8 +29,6 @@ from ceilometer.storage import models
|
||||
from ceilometer.tests.api import v2 as tests_api
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
admin_header = {"X-Roles": "admin",
|
||||
|
||||
@@ -22,16 +22,12 @@ import datetime
|
||||
import logging
|
||||
|
||||
import mock
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.openstack.common import timeutils
|
||||
from ceilometer.storage import models
|
||||
from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -16,15 +16,12 @@
|
||||
"""Test event, event_type and trait retrieval."""
|
||||
|
||||
import datetime
|
||||
import testscenarios
|
||||
|
||||
|
||||
from ceilometer.openstack.common import timeutils
|
||||
from ceilometer.storage import models
|
||||
from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
headers = {"X-Roles": "admin"}
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
import datetime
|
||||
import logging
|
||||
|
||||
import testscenarios
|
||||
import webtest.app
|
||||
|
||||
from ceilometer.openstack.common import timeutils
|
||||
@@ -31,8 +30,6 @@ from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import base64
|
||||
import datetime
|
||||
import json as jsonutils
|
||||
import logging
|
||||
import testscenarios
|
||||
import webtest.app
|
||||
|
||||
from ceilometer.publisher import utils
|
||||
@@ -31,8 +30,6 @@ from ceilometer import sample
|
||||
from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
import datetime
|
||||
import json
|
||||
import logging
|
||||
import testscenarios
|
||||
|
||||
|
||||
from ceilometer.openstack.common import timeutils
|
||||
from ceilometer.publisher import utils
|
||||
@@ -30,8 +28,6 @@ from ceilometer import sample
|
||||
from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
import copy
|
||||
import datetime
|
||||
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.openstack.common.fixture.mockpatch import PatchObject
|
||||
from ceilometer.openstack.common import rpc
|
||||
from ceilometer.openstack.common import timeutils
|
||||
@@ -30,9 +28,6 @@ from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class TestPostSamples(FunctionalTest,
|
||||
tests_db.MixinTestsWithBackendScenarios):
|
||||
|
||||
|
||||
@@ -19,15 +19,11 @@
|
||||
|
||||
import datetime
|
||||
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.publisher import utils
|
||||
from ceilometer import sample
|
||||
from ceilometer.tests.api.v2 import FunctionalTest
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class TestMaxProjectVolume(FunctionalTest,
|
||||
tests_db.MixinTestsWithBackendScenarios):
|
||||
|
||||
@@ -24,6 +24,7 @@ import uuid
|
||||
import warnings
|
||||
|
||||
import six
|
||||
import testscenarios.testcase
|
||||
|
||||
from ceilometer.openstack.common.fixture import config
|
||||
import ceilometer.openstack.common.fixture.mockpatch as oslo_mock
|
||||
@@ -31,7 +32,7 @@ from ceilometer import storage
|
||||
from ceilometer.tests import base as test_base
|
||||
|
||||
|
||||
class TestBase(test_base.BaseTestCase):
|
||||
class TestBase(testscenarios.testcase.WithScenarios, test_base.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(TestBase, self).setUp()
|
||||
|
||||
|
||||
@@ -22,15 +22,13 @@ import collections
|
||||
from keystoneclient import exceptions
|
||||
import mock
|
||||
from swiftclient import client as swift_client
|
||||
import testscenarios
|
||||
import testscenarios.testcase
|
||||
|
||||
from ceilometer.central import manager
|
||||
from ceilometer.objectstore import swift
|
||||
from ceilometer.openstack.common.fixture.mockpatch import PatchObject
|
||||
from ceilometer.openstack.common import test
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
HEAD_ACCOUNTS = [('tenant-000', {'x-account-object-count': 12,
|
||||
'x-account-bytes-used': 321321321,
|
||||
'x-account-container-count': 7,
|
||||
@@ -64,7 +62,8 @@ class TestManager(manager.AgentManager):
|
||||
self.keystone = mock.MagicMock()
|
||||
|
||||
|
||||
class TestSwiftPollster(test.BaseTestCase):
|
||||
class TestSwiftPollster(testscenarios.testcase.WithScenarios,
|
||||
test.BaseTestCase):
|
||||
|
||||
# Define scenarios to run all of the tests against all of the
|
||||
# pollsters.
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
|
||||
import datetime
|
||||
|
||||
import testscenarios
|
||||
|
||||
from ceilometer.openstack.common import timeutils
|
||||
from ceilometer.publisher import utils
|
||||
from ceilometer import sample
|
||||
@@ -32,8 +30,6 @@ from ceilometer.storage import base
|
||||
from ceilometer.storage import models
|
||||
from ceilometer.tests import db as tests_db
|
||||
|
||||
load_tests = testscenarios.load_tests_apply_scenarios
|
||||
|
||||
|
||||
class DBTestBase(tests_db.TestBase):
|
||||
def create_and_store_sample(self, timestamp=datetime.datetime.utcnow(),
|
||||
|
||||
Reference in New Issue
Block a user