Move integration tests under mistralclient/tests folder

- Collect all tests in one folder 'mistralclient/tests'.
- Create new folder 'functional' in the mistralclient/tests for integration functional tests.
- Restructure tests, create folder 'v1' for current tests (version 1).
- Create new folder 'unit' in the mistralclient/tests and put all unit tests here.
- Correct imports in the file with unit tests.

Change-Id: If92c11640d7cb61ee8ffcdc7ba99d7ab1061afa7
This commit is contained in:
Anastasia Kuznetsova 2014-08-07 18:36:19 +04:00
parent 717d81d252
commit b0d0c31361
20 changed files with 13 additions and 16 deletions

@ -28,4 +28,4 @@ TEMPEST_DIR=${TEMPEST_DIR:-/opt/stack/new/tempest}
# Add tempest source tree to PYTHONPATH
export PYTHONPATH=$PYTHONPATH:$TEMPEST_DIR
nosetests -sv functionaltests
nosetests -sv mistralclient/tests/functional/

@ -25,11 +25,8 @@ class MistralBase(testtools.TestCase):
mgr = clients.Manager()
cls.mistral_client = ClientAuth(mgr.auth_provider).mistral_client
__location = os.path.realpath(os.path.join(os.getcwd(),
os.path.dirname(__file__)))
cls.definition = open(os.path.join(
__location, 'hello.yaml'), 'rb').read()
cls.definition = open(os.path.relpath(
'functionaltests/hello.yaml', os.getcwd()), 'rb').read()
cls.wb = cls.mistral_client.workbooks.create(
"wb", "Description", ["tags"])

@ -18,7 +18,7 @@ import pkg_resources as pkg
import mock
from mistralclient.tests import base
from mistralclient.tests.unit import base
from mistralclient.commands import executions
from mistralclient.api.executions import Execution
@ -44,7 +44,7 @@ class TestCLIExecutions(base.BaseCommandTest):
def test_create_ctx_file(self, mock):
mock.return_value = EXECUTION
path = pkg.resource_filename('mistralclient',
'tests/resources/ctx.json')
'tests/unit/resources/ctx.json')
result = self.call(executions.Create,
app_args=['name', 'id', path])

@ -16,7 +16,7 @@
import mock
from mistralclient.tests import base
from mistralclient.tests.unit import base
from mistralclient.commands import tasks
from mistralclient.api.tasks import Task

@ -16,7 +16,7 @@
import mock
from mistralclient.tests import base
from mistralclient.tests.unit import base
from mistralclient.commands import workbooks
from mistralclient.api.workbooks import Workbook

@ -15,7 +15,7 @@
import unittest2
import json
from mistralclient.tests import base
from mistralclient.tests.unit import base
from mistralclient.api.executions import Execution
# TODO: Later we need additional tests verifying all the errors etc.

@ -14,7 +14,7 @@
import json
from mistralclient.tests import base
from mistralclient.tests.unit import base
from mistralclient.api.listeners import Listener
# TODO: later we need additional tests verifying all the errors etc.

@ -14,7 +14,7 @@
import json
from mistralclient.tests import base
from mistralclient.tests.unit import base
from mistralclient.api.tasks import Task
# TODO: later we need additional tests verifying all the errors etc.

@ -14,7 +14,7 @@
import json
from mistralclient.tests import base
from mistralclient.tests.unit import base
from mistralclient.api.workbooks import Workbook
# TODO: later we need additional tests verifying all the errors etc.

@ -15,11 +15,11 @@ setenv =
NOSE_OPENSTACK_SHOW_ELAPSED=1
NOSE_OPENSTACK_STDOUT=1
NOSE_XUNIT=1
DISCOVER_DIRECTORY=mistralclient/tests
DISCOVER_DIRECTORY=mistralclient/tests/unit
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = nosetests mistralclient/tests
commands = nosetests mistralclient/tests/unit
[testenv:pep8]
commands = flake8 {posargs}