Organize unit tests under tests/unit folder

Moving all unit tests to tests/unit so that we can start writing
functional tests for verifying notifier backends against osprofiler
patches.

Change-Id: I40a415df6e271f19c7b116471499d24eb45425db
This commit is contained in:
Vipin Balachandran 2016-11-23 13:07:14 +05:30
parent daf77e674b
commit 5fbbff1e02
20 changed files with 17 additions and 14 deletions

View File

@ -1,4 +1,4 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ./osprofiler/tests $LISTOPT $IDOPTION
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ./osprofiler/tests/unit $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -23,7 +23,7 @@ class TitlesTestCase(test.TestCase):
specs_path = os.path.join(
os.path.dirname(__file__),
os.pardir, os.pardir, os.pardir,
os.pardir, os.pardir, os.pardir, os.pardir,
"doc", "specs")
def _get_title(self, section_tree):

View File

@ -202,7 +202,7 @@ class TraceDecoratorTestCase(test.TestCase):
expected_info = {
"info": "some_info",
"function": {
"name": "osprofiler.tests.test_profiler.tracede_func",
"name": "osprofiler.tests.unit.test_profiler.tracede_func",
"args": str((1,)),
"kwargs": str({})
}
@ -216,7 +216,8 @@ class TraceDecoratorTestCase(test.TestCase):
self.assertEqual((1, 2), trace_hide_args_func(1, i=2))
expected_info = {
"function": {
"name": "osprofiler.tests.test_profiler.trace_hide_args_func"
"name": "osprofiler.tests.unit.test_profiler"
".trace_hide_args_func"
}
}
mock_start.assert_called_once_with("hide_args", info=expected_info)
@ -304,7 +305,7 @@ class TraceClsDecoratorTestCase(test.TestCase):
expected_info = {
"a": 10,
"function": {
"name": ("osprofiler.tests.test_profiler"
"name": ("osprofiler.tests.unit.test_profiler"
".FakeTraceClassWithInfo.method1"),
"args": str((fake_cls, 5, 15)),
"kwargs": str({})
@ -323,7 +324,7 @@ class TraceClsDecoratorTestCase(test.TestCase):
expected_info = {
"a": 10,
"function": {
"name": ("osprofiler.tests.test_profiler"
"name": ("osprofiler.tests.unit.test_profiler"
".FakeTraceClassWithInfo.method3"),
"args": str((fake_cls,)),
"kwargs": str({"g": 5, "h": 10})
@ -350,7 +351,7 @@ class TraceClsDecoratorTestCase(test.TestCase):
expected_info = {
"b": 20,
"function": {
"name": ("osprofiler.tests.test_profiler"
"name": ("osprofiler.tests.unit.test_profiler"
".FakeTraceClassHideArgs.method1"),
}
}
@ -368,7 +369,7 @@ class TraceClsDecoratorTestCase(test.TestCase):
expected_info = {
"function": {
"name": ("osprofiler.tests.test_profiler"
"name": ("osprofiler.tests.unit.test_profiler"
".FakeTracePrivate._method"),
"args": str((fake_cls, 5)),
"kwargs": str({})
@ -398,8 +399,10 @@ class TraceClsDecoratorTestCase(test.TestCase):
# static and doesn't have reference to class
# - and FakeTraceStatic.method4 in PY3
"name":
"osprofiler.tests.test_profiler.method4" if six.PY2 else
"osprofiler.tests.test_profiler.FakeTraceStatic.method4",
"osprofiler.tests.unit.test_profiler"
".method4" if six.PY2 else
"osprofiler.tests.unit.test_profiler.FakeTraceStatic"
".method4",
"args": str((25,)),
"kwargs": str({})
}
@ -482,7 +485,7 @@ class TraceWithMetaclassTestCase(test.TestCase):
expected_info = {
"a": 10,
"function": {
"name": ("osprofiler.tests.test_profiler"
"name": ("osprofiler.tests.unit.test_profiler"
".FakeTraceWithMetaclassBase.method1"),
"args": str((fake_cls, 5, 15)),
"kwargs": str({})
@ -501,7 +504,7 @@ class TraceWithMetaclassTestCase(test.TestCase):
expected_info = {
"a": 10,
"function": {
"name": ("osprofiler.tests.test_profiler"
"name": ("osprofiler.tests.unit.test_profiler"
".FakeTraceWithMetaclassBase.method3"),
"args": str((fake_cls,)),
"kwargs": str({"g": 5, "h": 10})
@ -528,7 +531,7 @@ class TraceWithMetaclassTestCase(test.TestCase):
expected_info = {
"b": 20,
"function": {
"name": ("osprofiler.tests.test_profiler"
"name": ("osprofiler.tests.unit.test_profiler"
".FakeTraceWithMetaclassHideArgs.method5")
}
}
@ -546,7 +549,7 @@ class TraceWithMetaclassTestCase(test.TestCase):
expected_info = {
"function": {
"name": ("osprofiler.tests.test_profiler"
"name": ("osprofiler.tests.unit.test_profiler"
".FakeTraceWithMetaclassPrivate._new_private_method"),
"args": str((fake_cls, 5)),
"kwargs": str({})