Browse Source

Make room for functional tests

We need to consolidate the unit tests into a separate
directory so we can run just the unit tests in our py27
tox target. And we can in subsequent reviews add a parallel
directory with functional tests.

Related-Bug: #1439621
Change-Id: I8bf5af953fb31080096c371966f7dfda9edb1bf4
changes/59/169359/5
Davanum Srinivas 6 years ago
parent
commit
aa039bb011
  1. 2
      .testr.conf
  2. 28
      magnum/tests/test_magnum.py
  3. 19
      magnum/tests/test_units.py
  4. 0
      magnum/tests/unit/__init__.py
  5. 0
      magnum/tests/unit/api/__init__.py
  6. 2
      magnum/tests/unit/api/base.py
  7. 0
      magnum/tests/unit/api/controllers/__init__.py
  8. 0
      magnum/tests/unit/api/controllers/test_root.py
  9. 0
      magnum/tests/unit/api/controllers/v1/__init__.py
  10. 0
      magnum/tests/unit/api/controllers/v1/test_base.py
  11. 6
      magnum/tests/unit/api/controllers/v1/test_bay.py
  12. 6
      magnum/tests/unit/api/controllers/v1/test_baymodel.py
  13. 2
      magnum/tests/unit/api/controllers/v1/test_container.py
  14. 6
      magnum/tests/unit/api/controllers/v1/test_node.py
  15. 6
      magnum/tests/unit/api/controllers/v1/test_pod.py
  16. 6
      magnum/tests/unit/api/controllers/v1/test_replicationcontroller.py
  17. 6
      magnum/tests/unit/api/controllers/v1/test_service.py
  18. 2
      magnum/tests/unit/api/controllers/v1/test_types.py
  19. 2
      magnum/tests/unit/api/controllers/v1/test_utils.py
  20. 0
      magnum/tests/unit/api/test_app.py
  21. 0
      magnum/tests/unit/api/test_auth.py
  22. 2
      magnum/tests/unit/api/test_hooks.py
  23. 2
      magnum/tests/unit/api/utils.py
  24. 0
      magnum/tests/unit/common/__init__.py
  25. 0
      magnum/tests/unit/common/test_clients.py
  26. 0
      magnum/tests/unit/common/test_context.py
  27. 0
      magnum/tests/unit/common/test_exception.py
  28. 0
      magnum/tests/unit/common/test_k8s_manifest.py
  29. 0
      magnum/tests/unit/common/test_magnum_keystoneclient.py
  30. 0
      magnum/tests/unit/common/test_safeutils.py
  31. 0
      magnum/tests/unit/common/test_short_id.py
  32. 0
      magnum/tests/unit/common/test_urlfetch.py
  33. 0
      magnum/tests/unit/common/test_utils.py
  34. 0
      magnum/tests/unit/common/test_yamlutils.py
  35. 0
      magnum/tests/unit/conductor/__init__.py
  36. 0
      magnum/tests/unit/conductor/handlers/__init__.py
  37. 0
      magnum/tests/unit/conductor/handlers/common/__init__.py
  38. 0
      magnum/tests/unit/conductor/handlers/common/test_kube_utils.py
  39. 4
      magnum/tests/unit/conductor/handlers/test_bay_k8s_heat.py
  40. 0
      magnum/tests/unit/conductor/handlers/test_docker_conductor.py
  41. 0
      magnum/tests/unit/conductor/handlers/test_kube.py
  42. 0
      magnum/tests/unit/conductor/tasks/__init__.py
  43. 0
      magnum/tests/unit/conductor/tasks/test_heat_tasks.py
  44. 4
      magnum/tests/unit/conductor/test_rpcapi.py
  45. 0
      magnum/tests/unit/db/__init__.py
  46. 0
      magnum/tests/unit/db/base.py
  47. 0
      magnum/tests/unit/db/sqlalchemy/__init__.py
  48. 2
      magnum/tests/unit/db/sqlalchemy/test_types.py
  49. 4
      magnum/tests/unit/db/test_bay.py
  50. 4
      magnum/tests/unit/db/test_baymodel.py
  51. 4
      magnum/tests/unit/db/test_container.py
  52. 4
      magnum/tests/unit/db/test_node.py
  53. 4
      magnum/tests/unit/db/test_pod.py
  54. 4
      magnum/tests/unit/db/test_replicationcontroller.py
  55. 4
      magnum/tests/unit/db/test_service.py
  56. 0
      magnum/tests/unit/db/utils.py
  57. 0
      magnum/tests/unit/objects/__init__.py
  58. 4
      magnum/tests/unit/objects/test_bay.py
  59. 4
      magnum/tests/unit/objects/test_baymodel.py
  60. 4
      magnum/tests/unit/objects/test_container.py
  61. 4
      magnum/tests/unit/objects/test_node.py
  62. 0
      magnum/tests/unit/objects/test_objects.py
  63. 0
      magnum/tests/unit/objects/test_objects_sqlalchemy.py
  64. 4
      magnum/tests/unit/objects/test_pod.py
  65. 4
      magnum/tests/unit/objects/test_replicationcontroller.py
  66. 4
      magnum/tests/unit/objects/test_service.py
  67. 2
      magnum/tests/unit/objects/utils.py

2
.testr.conf

@ -2,6 +2,6 @@
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-160} \
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./magnum/tests} $LISTOPT $IDOPTION
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./magnum/tests/unit} $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

28
magnum/tests/test_magnum.py

@ -1,28 +0,0 @@
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""
test_magnum
----------------------------------
Tests for `magnum` module.
"""
from magnum.tests import base
class TestMagnum(base.TestCase):
def test_something(self):
pass

19
magnum/tests/test_units.py

@ -1,19 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import unittest
class TestUnits(unittest.TestCase):
def test_units(self):
assert 5 * 5 == 25

0
magnum/tests/api/__init__.py → magnum/tests/unit/__init__.py

0
magnum/tests/api/controllers/__init__.py → magnum/tests/unit/api/__init__.py

2
magnum/tests/api/base.py → magnum/tests/unit/api/base.py

@ -27,7 +27,7 @@ from six.moves.urllib import parse as urlparse
from magnum.api import hooks
from magnum.db import api as dbapi
from magnum.tests.db import base
from magnum.tests.unit.db import base
PATH_PREFIX = '/v1'

0
magnum/tests/api/controllers/v1/__init__.py → magnum/tests/unit/api/controllers/__init__.py

0
magnum/tests/api/controllers/test_root.py → magnum/tests/unit/api/controllers/test_root.py

0
magnum/tests/common/__init__.py → magnum/tests/unit/api/controllers/v1/__init__.py

0
magnum/tests/api/controllers/v1/test_base.py → magnum/tests/unit/api/controllers/v1/test_base.py

6
magnum/tests/api/controllers/v1/test_bay.py → magnum/tests/unit/api/controllers/v1/test_bay.py

@ -22,10 +22,10 @@ from magnum.api.controllers.v1 import bay as api_bay
from magnum.common import utils
from magnum.conductor import api as rpcapi
from magnum import objects
from magnum.tests.api import base as api_base
from magnum.tests.api import utils as apiutils
from magnum.tests import base
from magnum.tests.objects import utils as obj_utils
from magnum.tests.unit.api import base as api_base
from magnum.tests.unit.api import utils as apiutils
from magnum.tests.unit.objects import utils as obj_utils
class TestBayObject(base.TestCase):

6
magnum/tests/api/controllers/v1/test_baymodel.py → magnum/tests/unit/api/controllers/v1/test_baymodel.py

@ -21,10 +21,10 @@ from wsme import types as wtypes
from magnum.api.controllers.v1 import baymodel as api_baymodel
from magnum.common import utils
from magnum.tests.api import base as api_base
from magnum.tests.api import utils as apiutils
from magnum.tests import base
from magnum.tests.objects import utils as obj_utils
from magnum.tests.unit.api import base as api_base
from magnum.tests.unit.api import utils as apiutils
from magnum.tests.unit.objects import utils as obj_utils
class TestBayModelObject(base.TestCase):

2
magnum/tests/api/controllers/v1/test_container.py → magnum/tests/unit/api/controllers/v1/test_container.py

@ -9,7 +9,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from magnum.tests.db import base as db_base
from magnum.tests.unit.db import base as db_base
from mock import patch
from webtest.app import AppError

6
magnum/tests/api/controllers/v1/test_node.py → magnum/tests/unit/api/controllers/v1/test_node.py

@ -20,10 +20,10 @@ from wsme import types as wtypes
from magnum.api.controllers.v1 import node as api_node
from magnum.common import utils
from magnum.tests.api import base as api_base
from magnum.tests.api import utils as apiutils
from magnum.tests import base
from magnum.tests.objects import utils as obj_utils
from magnum.tests.unit.api import base as api_base
from magnum.tests.unit.api import utils as apiutils
from magnum.tests.unit.objects import utils as obj_utils
class TestNodeObject(base.TestCase):

6
magnum/tests/api/controllers/v1/test_pod.py → magnum/tests/unit/api/controllers/v1/test_pod.py

@ -22,10 +22,10 @@ from magnum.api.controllers.v1 import pod as api_pod
from magnum.common import utils
from magnum.conductor import api as rpcapi
from magnum import objects
from magnum.tests.api import base as api_base
from magnum.tests.api import utils as apiutils
from magnum.tests import base
from magnum.tests.objects import utils as obj_utils
from magnum.tests.unit.api import base as api_base
from magnum.tests.unit.api import utils as apiutils
from magnum.tests.unit.objects import utils as obj_utils
class TestPodObject(base.TestCase):

6
magnum/tests/api/controllers/v1/test_replicationcontroller.py → magnum/tests/unit/api/controllers/v1/test_replicationcontroller.py

@ -22,10 +22,10 @@ from magnum.api.controllers.v1 import replicationcontroller as api_rc
from magnum.common import utils
from magnum.conductor import api as rpcapi
from magnum import objects
from magnum.tests.api import base as api_base
from magnum.tests.api import utils as apiutils
from magnum.tests import base
from magnum.tests.objects import utils as obj_utils
from magnum.tests.unit.api import base as api_base
from magnum.tests.unit.api import utils as apiutils
from magnum.tests.unit.objects import utils as obj_utils
class TestRCObject(base.TestCase):

6
magnum/tests/api/controllers/v1/test_service.py → magnum/tests/unit/api/controllers/v1/test_service.py

@ -22,10 +22,10 @@ from magnum.api.controllers.v1 import service as api_service
from magnum.common import utils
from magnum.conductor import api as rpcapi
from magnum import objects
from magnum.tests.api import base as api_base
from magnum.tests.api import utils as apiutils
from magnum.tests import base
from magnum.tests.objects import utils as obj_utils
from magnum.tests.unit.api import base as api_base
from magnum.tests.unit.api import utils as apiutils
from magnum.tests.unit.objects import utils as obj_utils
class TestServiceObject(base.TestCase):

2
magnum/tests/api/controllers/v1/test_types.py → magnum/tests/unit/api/controllers/v1/test_types.py

@ -23,7 +23,7 @@ import wsme
from magnum.api.controllers.v1 import types
from magnum.common import exception
from magnum.common import utils
from magnum.tests.api import base
from magnum.tests.unit.api import base
class TestMacAddressType(base.FunctionalTest):

2
magnum/tests/api/controllers/v1/test_utils.py → magnum/tests/unit/api/controllers/v1/test_utils.py

@ -16,7 +16,7 @@
import wsme
from magnum.api.controllers.v1 import utils
from magnum.tests.api import base
from magnum.tests.unit.api import base
from oslo_config import cfg

0
magnum/tests/api/test_app.py → magnum/tests/unit/api/test_app.py

0
magnum/tests/api/test_auth.py → magnum/tests/unit/api/test_auth.py

2
magnum/tests/api/test_hooks.py → magnum/tests/unit/api/test_hooks.py

@ -22,9 +22,9 @@ import oslo_messaging as messaging
from magnum.api.controllers import root
from magnum.api import hooks
from magnum.common import context as magnum_context
from magnum.tests.api import base as api_base
from magnum.tests import base
from magnum.tests import fakes
from magnum.tests.unit.api import base as api_base
class TestContextHook(base.BaseTestCase):

2
magnum/tests/api/utils.py → magnum/tests/unit/api/utils.py

@ -19,7 +19,7 @@ from magnum.api.controllers.v1 import node as node_controller
from magnum.api.controllers.v1 import pod as pod_controller
from magnum.api.controllers.v1 import replicationcontroller as rc_controller
from magnum.api.controllers.v1 import service as service_controller
from magnum.tests.db import utils
from magnum.tests.unit.db import utils
def remove_internal(values, internal):

0
magnum/tests/conductor/__init__.py → magnum/tests/unit/common/__init__.py

0
magnum/tests/common/test_clients.py → magnum/tests/unit/common/test_clients.py

0
magnum/tests/common/test_context.py → magnum/tests/unit/common/test_context.py

0
magnum/tests/common/test_exception.py → magnum/tests/unit/common/test_exception.py

0
magnum/tests/common/test_k8s_manifest.py → magnum/tests/unit/common/test_k8s_manifest.py

0
magnum/tests/common/test_magnum_keystoneclient.py → magnum/tests/unit/common/test_magnum_keystoneclient.py

0
magnum/tests/common/test_safeutils.py → magnum/tests/unit/common/test_safeutils.py

0
magnum/tests/common/test_short_id.py → magnum/tests/unit/common/test_short_id.py

0
magnum/tests/common/test_urlfetch.py → magnum/tests/unit/common/test_urlfetch.py

0
magnum/tests/common/test_utils.py → magnum/tests/unit/common/test_utils.py

0
magnum/tests/common/test_yamlutils.py → magnum/tests/unit/common/test_yamlutils.py

0
magnum/tests/conductor/handlers/__init__.py → magnum/tests/unit/conductor/__init__.py

0
magnum/tests/conductor/handlers/common/__init__.py → magnum/tests/unit/conductor/handlers/__init__.py

0
magnum/tests/conductor/tasks/__init__.py → magnum/tests/unit/conductor/handlers/common/__init__.py

0
magnum/tests/conductor/handlers/common/test_kube_utils.py → magnum/tests/unit/conductor/handlers/common/test_kube_utils.py

4
magnum/tests/conductor/handlers/test_bay_k8s_heat.py → magnum/tests/unit/conductor/handlers/test_bay_k8s_heat.py

@ -19,8 +19,8 @@ from magnum.conductor.handlers import bay_k8s_heat
from magnum import objects
from magnum.openstack.common import loopingcall
from magnum.tests import base
from magnum.tests.db import base as db_base
from magnum.tests.db import utils
from magnum.tests.unit.db import base as db_base
from magnum.tests.unit.db import utils
import mock
from mock import patch

0
magnum/tests/conductor/handlers/test_docker_conductor.py → magnum/tests/unit/conductor/handlers/test_docker_conductor.py

0
magnum/tests/conductor/handlers/test_kube.py → magnum/tests/unit/conductor/handlers/test_kube.py

0
magnum/tests/db/__init__.py → magnum/tests/unit/conductor/tasks/__init__.py

0
magnum/tests/conductor/tasks/test_heat_tasks.py → magnum/tests/unit/conductor/tasks/test_heat_tasks.py

4
magnum/tests/conductor/test_rpcapi.py → magnum/tests/unit/conductor/test_rpcapi.py

@ -18,8 +18,8 @@ import copy
import mock
from magnum.conductor import api as conductor_rpcapi
from magnum.tests.db import base
from magnum.tests.db import utils as dbutils
from magnum.tests.unit.db import base
from magnum.tests.unit.db import utils as dbutils
class RPCAPITestCase(base.DbTestCase):

0
magnum/tests/db/sqlalchemy/__init__.py → magnum/tests/unit/db/__init__.py

0
magnum/tests/db/base.py → magnum/tests/unit/db/base.py

0
magnum/tests/objects/__init__.py → magnum/tests/unit/db/sqlalchemy/__init__.py

2
magnum/tests/db/sqlalchemy/test_types.py → magnum/tests/unit/db/sqlalchemy/test_types.py

@ -18,7 +18,7 @@ from magnum.common import utils as magnum_utils
from magnum.db import api as dbapi
import magnum.db.sqlalchemy.api as sa_api
from magnum.db.sqlalchemy import models
from magnum.tests.db import base
from magnum.tests.unit.db import base
class SqlAlchemyCustomTypesTestCase(base.DbTestCase):

4
magnum/tests/db/test_bay.py → magnum/tests/unit/db/test_bay.py

@ -19,8 +19,8 @@ import six
from magnum.common import exception
from magnum.common import utils as magnum_utils
from magnum.tests.db import base
from magnum.tests.db import utils
from magnum.tests.unit.db import base
from magnum.tests.unit.db import utils
class DbBayTestCase(base.DbTestCase):

4
magnum/tests/db/test_baymodel.py → magnum/tests/unit/db/test_baymodel.py

@ -19,8 +19,8 @@ import six
from magnum.common import exception
from magnum.common import utils as magnum_utils
from magnum.tests.db import base
from magnum.tests.db import utils
from magnum.tests.unit.db import base
from magnum.tests.unit.db import utils
class DbBaymodelTestCase(base.DbTestCase):

4
magnum/tests/db/test_container.py → magnum/tests/unit/db/test_container.py

@ -19,8 +19,8 @@ import six
from magnum.common import exception
from magnum.common import utils as magnum_utils
from magnum.tests.db import base
from magnum.tests.db import utils
from magnum.tests.unit.db import base
from magnum.tests.unit.db import utils
class DbContainerTestCase(base.DbTestCase):

4
magnum/tests/db/test_node.py → magnum/tests/unit/db/test_node.py

@ -19,8 +19,8 @@ import six
from magnum.common import exception
from magnum.common import utils as magnum_utils
from magnum.tests.db import base
from magnum.tests.db import utils
from magnum.tests.unit.db import base
from magnum.tests.unit.db import utils
class DbNodeTestCase(base.DbTestCase):

4
magnum/tests/db/test_pod.py → magnum/tests/unit/db/test_pod.py

@ -19,8 +19,8 @@ import six
from magnum.common import exception
from magnum.common import utils as magnum_utils
from magnum.tests.db import base
from magnum.tests.db import utils as utils
from magnum.tests.unit.db import base
from magnum.tests.unit.db import utils as utils
class DbPodTestCase(base.DbTestCase):

4
magnum/tests/db/test_replicationcontroller.py → magnum/tests/unit/db/test_replicationcontroller.py

@ -19,8 +19,8 @@ import six
from magnum.common import exception
from magnum.common import utils as magnum_utils
from magnum.tests.db import base
from magnum.tests.db import utils as utils
from magnum.tests.unit.db import base
from magnum.tests.unit.db import utils as utils
class DbRCTestCase(base.DbTestCase):

4
magnum/tests/db/test_service.py → magnum/tests/unit/db/test_service.py

@ -19,8 +19,8 @@ import six
from magnum.common import exception
from magnum.common import utils as magnum_utils
from magnum.tests.db import base
from magnum.tests.db import utils as utils
from magnum.tests.unit.db import base
from magnum.tests.unit.db import utils as utils
class DbServiceTestCase(base.DbTestCase):

0
magnum/tests/db/utils.py → magnum/tests/unit/db/utils.py

0
magnum/tests/unit/objects/__init__.py

4
magnum/tests/objects/test_bay.py → magnum/tests/unit/objects/test_bay.py

@ -19,8 +19,8 @@ from testtools.matchers import HasLength
from magnum.common import exception
from magnum.common import utils as magnum_utils
from magnum import objects
from magnum.tests.db import base
from magnum.tests.db import utils
from magnum.tests.unit.db import base
from magnum.tests.unit.db import utils
class TestBayObject(base.DbTestCase):

4
magnum/tests/objects/test_baymodel.py → magnum/tests/unit/objects/test_baymodel.py

@ -19,8 +19,8 @@ from testtools.matchers import HasLength
from magnum.common import exception
from magnum.common import utils as magnum_utils
from magnum import objects
from magnum.tests.db import base
from magnum.tests.db import utils
from magnum.tests.unit.db import base
from magnum.tests.unit.db import utils
class TestBayModelObject(base.DbTestCase):

4
magnum/tests/objects/test_container.py → magnum/tests/unit/objects/test_container.py

@ -18,8 +18,8 @@ from testtools.matchers import HasLength
from magnum.common import utils as magnum_utils
from magnum import objects
from magnum.tests.db import base
from magnum.tests.db import utils
from magnum.tests.unit.db import base
from magnum.tests.unit.db import utils
class TestContainerObject(base.DbTestCase):

4
magnum/tests/objects/test_node.py → magnum/tests/unit/objects/test_node.py

@ -18,8 +18,8 @@ from testtools.matchers import HasLength
from magnum.common import utils as magnum_utils
from magnum import objects
from magnum.tests.db import base
from magnum.tests.db import utils
from magnum.tests.unit.db import base
from magnum.tests.unit.db import utils
class TestNodeObject(base.DbTestCase):

0
magnum/tests/objects/test_objects.py → magnum/tests/unit/objects/test_objects.py

0
magnum/tests/objects/test_objects_sqlalchemy.py → magnum/tests/unit/objects/test_objects_sqlalchemy.py

4
magnum/tests/objects/test_pod.py → magnum/tests/unit/objects/test_pod.py

@ -18,8 +18,8 @@ from testtools.matchers import HasLength
from magnum.common import utils as magnum_utils
from magnum import objects
from magnum.tests.db import base
from magnum.tests.db import utils
from magnum.tests.unit.db import base
from magnum.tests.unit.db import utils
class TestPodObject(base.DbTestCase):

4
magnum/tests/objects/test_replicationcontroller.py → magnum/tests/unit/objects/test_replicationcontroller.py

@ -18,8 +18,8 @@ from testtools.matchers import HasLength
from magnum.common import utils as magnum_utils
from magnum import objects
from magnum.tests.db import base
from magnum.tests.db import utils
from magnum.tests.unit.db import base
from magnum.tests.unit.db import utils
class TestReplicationControllerObject(base.DbTestCase):

4
magnum/tests/objects/test_service.py → magnum/tests/unit/objects/test_service.py

@ -18,8 +18,8 @@ from testtools.matchers import HasLength
from magnum.common import utils as magnum_utils
from magnum import objects
from magnum.tests.db import base
from magnum.tests.db import utils
from magnum.tests.unit.db import base
from magnum.tests.unit.db import utils
class TestServiceObject(base.DbTestCase):

2
magnum/tests/objects/utils.py → magnum/tests/unit/objects/utils.py

@ -15,7 +15,7 @@
"""Magnum object test utilities."""
from magnum import objects
from magnum.tests.db import utils as db_utils
from magnum.tests.unit.db import utils as db_utils
def get_test_baymodel(context, **kw):
Loading…
Cancel
Save