Move osprofiler tests into osprofiler
To follow the pattern that nearly all oslo tests follow move the tests out of the osprofiler root directory and into the osprofiler module itself. This makes it easier for new people to get involved and follows the more common directory structure that people should already be used to. Change-Id: I384cdb5466d852dd4493e4fce2f0078545724416
This commit is contained in:
parent
bf7219a1ee
commit
f9a2c8121e
@ -1,4 +1,4 @@
|
||||
[DEFAULT]
|
||||
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ./tests $LISTOPT $IDOPTION
|
||||
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ./osprofiler/tests $LISTOPT $IDOPTION
|
||||
test_id_option=--load-list $IDFILE
|
||||
test_list_option=--list
|
||||
|
@ -22,7 +22,7 @@ import six
|
||||
|
||||
from osprofiler.cmd import exc
|
||||
from osprofiler.cmd import shell
|
||||
from tests import test
|
||||
from osprofiler.tests import test
|
||||
|
||||
|
||||
class ShellTestCase(test.TestCase):
|
@ -16,13 +16,15 @@ import re
|
||||
|
||||
import docutils.core
|
||||
|
||||
from tests import test
|
||||
from osprofiler.tests import test
|
||||
|
||||
|
||||
class TitlesTestCase(test.TestCase):
|
||||
|
||||
specs_path = os.path.join(
|
||||
os.path.dirname(__file__), os.pardir, os.pardir, "doc", "specs")
|
||||
os.path.dirname(__file__),
|
||||
os.pardir, os.pardir, os.pardir,
|
||||
"doc", "specs")
|
||||
|
||||
def _get_title(self, section_tree):
|
||||
section = {"subtitles": []}
|
@ -16,7 +16,7 @@
|
||||
import mock
|
||||
|
||||
from osprofiler._notifiers import base
|
||||
from tests import test
|
||||
from osprofiler.tests import test
|
||||
|
||||
|
||||
class NotifierBaseTestCase(test.TestCase):
|
@ -16,7 +16,7 @@
|
||||
import mock
|
||||
|
||||
from osprofiler._notifiers import base
|
||||
from tests import test
|
||||
from osprofiler.tests import test
|
||||
|
||||
|
||||
class MessagingTestCase(test.TestCase):
|
@ -16,8 +16,7 @@
|
||||
import mock
|
||||
|
||||
from osprofiler.parsers import ceilometer
|
||||
|
||||
from tests import test
|
||||
from osprofiler.tests import test
|
||||
|
||||
|
||||
class CeilometerParserTestCase(test.TestCase):
|
@ -16,7 +16,7 @@
|
||||
import mock
|
||||
|
||||
from osprofiler import notifier
|
||||
from tests import test
|
||||
from osprofiler.tests import test
|
||||
|
||||
|
||||
class NotifierTestCase(test.TestCase):
|
@ -16,7 +16,7 @@
|
||||
import mock
|
||||
from oslo_config import fixture
|
||||
from osprofiler import opts
|
||||
from tests import test
|
||||
from osprofiler.tests import test
|
||||
|
||||
|
||||
class ConfigTestCase(test.TestCase):
|
@ -22,8 +22,7 @@ import re
|
||||
import six
|
||||
|
||||
from osprofiler import profiler
|
||||
|
||||
from tests import test
|
||||
from osprofiler.tests import test
|
||||
|
||||
|
||||
class ProfilerGlobMethodsTestCase(test.TestCase):
|
||||
@ -177,7 +176,7 @@ class TraceDecoratorTestCase(test.TestCase):
|
||||
expected_info = {
|
||||
"info": "some_info",
|
||||
"function": {
|
||||
"name": "tests.test_profiler.tracede_func",
|
||||
"name": "osprofiler.tests.test_profiler.tracede_func",
|
||||
"args": str((1,)),
|
||||
"kwargs": str({})
|
||||
}
|
||||
@ -191,7 +190,7 @@ class TraceDecoratorTestCase(test.TestCase):
|
||||
self.assertEqual((1, 2), trace_hide_args_func(1, i=2))
|
||||
expected_info = {
|
||||
"function": {
|
||||
"name": "tests.test_profiler.trace_hide_args_func"
|
||||
"name": "osprofiler.tests.test_profiler.trace_hide_args_func"
|
||||
}
|
||||
}
|
||||
mock_start.assert_called_once_with("hide_args", info=expected_info)
|
||||
@ -252,7 +251,8 @@ class TraceClsDecoratorTestCase(test.TestCase):
|
||||
expected_info = {
|
||||
"a": 10,
|
||||
"function": {
|
||||
"name": "tests.test_profiler.FakeTraceClassWithInfo.method1",
|
||||
"name": ("osprofiler.tests.test_profiler"
|
||||
".FakeTraceClassWithInfo.method1"),
|
||||
"args": str((fake_cls, 5, 15)),
|
||||
"kwargs": str({})
|
||||
}
|
||||
@ -270,7 +270,8 @@ class TraceClsDecoratorTestCase(test.TestCase):
|
||||
expected_info = {
|
||||
"a": 10,
|
||||
"function": {
|
||||
"name": "tests.test_profiler.FakeTraceClassWithInfo.method3",
|
||||
"name": ("osprofiler.tests.test_profiler"
|
||||
".FakeTraceClassWithInfo.method3"),
|
||||
"args": str((fake_cls,)),
|
||||
"kwargs": str({"g": 5, "h": 10})
|
||||
}
|
||||
@ -296,7 +297,8 @@ class TraceClsDecoratorTestCase(test.TestCase):
|
||||
expected_info = {
|
||||
"b": 20,
|
||||
"function": {
|
||||
"name": "tests.test_profiler.FakeTraceClassHideArgs.method1"
|
||||
"name": ("osprofiler.tests.test_profiler"
|
||||
".FakeTraceClassHideArgs.method1"),
|
||||
}
|
||||
}
|
||||
|
||||
@ -313,7 +315,8 @@ class TraceClsDecoratorTestCase(test.TestCase):
|
||||
|
||||
expected_info = {
|
||||
"function": {
|
||||
"name": "tests.test_profiler.FakeTracePrivate._method",
|
||||
"name": ("osprofiler.tests.test_profiler"
|
||||
".FakeTracePrivate._method"),
|
||||
"args": str((fake_cls, 5)),
|
||||
"kwargs": str({})
|
||||
}
|
||||
@ -382,8 +385,8 @@ class TraceWithMetaclassTestCase(test.TestCase):
|
||||
expected_info = {
|
||||
"a": 10,
|
||||
"function": {
|
||||
"name":
|
||||
"tests.test_profiler.FakeTraceWithMetaclassBase.method1",
|
||||
"name": ("osprofiler.tests.test_profiler"
|
||||
".FakeTraceWithMetaclassBase.method1"),
|
||||
"args": str((fake_cls, 5, 15)),
|
||||
"kwargs": str({})
|
||||
}
|
||||
@ -401,8 +404,8 @@ class TraceWithMetaclassTestCase(test.TestCase):
|
||||
expected_info = {
|
||||
"a": 10,
|
||||
"function": {
|
||||
"name":
|
||||
"tests.test_profiler.FakeTraceWithMetaclassBase.method3",
|
||||
"name": ("osprofiler.tests.test_profiler"
|
||||
".FakeTraceWithMetaclassBase.method3"),
|
||||
"args": str((fake_cls,)),
|
||||
"kwargs": str({"g": 5, "h": 10})
|
||||
}
|
||||
@ -428,8 +431,8 @@ class TraceWithMetaclassTestCase(test.TestCase):
|
||||
expected_info = {
|
||||
"b": 20,
|
||||
"function": {
|
||||
"name": "tests.test_profiler.FakeTraceWithMetaclassHideArgs."
|
||||
"method5"
|
||||
"name": ("osprofiler.tests.test_profiler"
|
||||
".FakeTraceWithMetaclassHideArgs.method5")
|
||||
}
|
||||
}
|
||||
|
||||
@ -446,8 +449,8 @@ class TraceWithMetaclassTestCase(test.TestCase):
|
||||
|
||||
expected_info = {
|
||||
"function": {
|
||||
"name": "tests.test_profiler.FakeTraceWithMetaclassPrivate."
|
||||
"_new_private_method",
|
||||
"name": ("osprofiler.tests.test_profiler"
|
||||
".FakeTraceWithMetaclassPrivate._new_private_method"),
|
||||
"args": str((fake_cls, 5)),
|
||||
"kwargs": str({})
|
||||
}
|
@ -16,8 +16,7 @@
|
||||
import mock
|
||||
|
||||
from osprofiler import sqlalchemy
|
||||
|
||||
from tests import test
|
||||
from osprofiler.tests import test
|
||||
|
||||
|
||||
class SqlalchemyTracingTestCase(test.TestCase):
|
@ -20,7 +20,7 @@ import hmac
|
||||
import mock
|
||||
|
||||
from osprofiler import _utils as utils
|
||||
from tests import test
|
||||
from osprofiler.tests import test
|
||||
|
||||
|
||||
class UtilsTestCase(test.TestCase):
|
@ -20,7 +20,7 @@ from osprofiler import _utils as utils
|
||||
from osprofiler import profiler
|
||||
from osprofiler import web
|
||||
|
||||
from tests import test
|
||||
from osprofiler.tests import test
|
||||
|
||||
|
||||
def dummy_app(environ, response):
|
Loading…
Reference in New Issue
Block a user