Skip to content

Commit

Permalink
Merge "Move osprofiler tests into osprofiler"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Jan 26, 2016
2 parents 4358b08 + f9a2c81 commit 85b47a1
Show file tree
Hide file tree
Showing 21 changed files with 34 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .testr.conf
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from osprofiler.cmd import exc
from osprofiler.cmd import shell
from tests import test
from osprofiler.tests import test


class ShellTestCase(test.TestCase):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@

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": []}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import mock

from osprofiler._notifiers import base
from tests import test
from osprofiler.tests import test


class NotifierBaseTestCase(test.TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import mock

from osprofiler._notifiers import base
from tests import test
from osprofiler.tests import test


class MessagingTestCase(test.TestCase):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
import mock

from osprofiler.parsers import ceilometer

from tests import test
from osprofiler.tests import test


class CeilometerParserTestCase(test.TestCase):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import mock

from osprofiler import notifier
from tests import test
from osprofiler.tests import test


class NotifierTestCase(test.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_opts.py → osprofiler/tests/test_opts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
35 changes: 19 additions & 16 deletions tests/test_profiler.py → osprofiler/tests/test_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
import six

from osprofiler import profiler

from tests import test
from osprofiler.tests import test


class ProfilerGlobMethodsTestCase(test.TestCase):
Expand Down Expand Up @@ -177,7 +176,7 @@ def test_with_args(self, mock_start, mock_stop):
expected_info = {
"info": "some_info",
"function": {
"name": "tests.test_profiler.tracede_func",
"name": "osprofiler.tests.test_profiler.tracede_func",
"args": str((1,)),
"kwargs": str({})
}
Expand All @@ -191,7 +190,7 @@ def test_without_args(self, mock_start, mock_stop):
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)
Expand Down Expand Up @@ -252,7 +251,8 @@ def test_args(self, mock_start, mock_stop):
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({})
}
Expand All @@ -270,7 +270,8 @@ def test_kwargs(self, mock_start, mock_stop):
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})
}
Expand All @@ -296,7 +297,8 @@ def test_without_args(self, mock_start, mock_stop):
expected_info = {
"b": 20,
"function": {
"name": "tests.test_profiler.FakeTraceClassHideArgs.method1"
"name": ("osprofiler.tests.test_profiler"
".FakeTraceClassHideArgs.method1"),
}
}

Expand All @@ -313,7 +315,8 @@ def test_private_methods(self, mock_start, mock_stop):

expected_info = {
"function": {
"name": "tests.test_profiler.FakeTracePrivate._method",
"name": ("osprofiler.tests.test_profiler"
".FakeTracePrivate._method"),
"args": str((fake_cls, 5)),
"kwargs": str({})
}
Expand Down Expand Up @@ -382,8 +385,8 @@ def test_args(self, mock_start, mock_stop):
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({})
}
Expand All @@ -401,8 +404,8 @@ def test_kwargs(self, mock_start, mock_stop):
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})
}
Expand All @@ -428,8 +431,8 @@ def test_without_args(self, mock_start, mock_stop):
expected_info = {
"b": 20,
"function": {
"name": "tests.test_profiler.FakeTraceWithMetaclassHideArgs."
"method5"
"name": ("osprofiler.tests.test_profiler"
".FakeTraceWithMetaclassHideArgs.method5")
}
}

Expand All @@ -446,8 +449,8 @@ def test_private_methods(self, mock_start, mock_stop):

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({})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
import mock

from osprofiler import sqlalchemy

from tests import test
from osprofiler.tests import test


class SqlalchemyTracingTestCase(test.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py → osprofiler/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import mock

from osprofiler import _utils as utils
from tests import test
from osprofiler.tests import test


class UtilsTestCase(test.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_web.py → osprofiler/tests/test_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from osprofiler import profiler
from osprofiler import web

from tests import test
from osprofiler.tests import test


def dummy_app(environ, response):
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,setup.py

[hacking]
local-check-factory = tests.hacking.checks.factory
local-check-factory = osprofiler.tests.hacking.checks.factory

0 comments on commit 85b47a1

Please sign in to comment.