Place all unit tests under single subdir

Make all tests be under single subdir for ease of its usage.
If possible, tests modules should follow following naming template:
path/[tests]/to/[test_]module.py

Change-Id: Id0a5f4aa72d01f43d0ae66659a6bc58a75857f75
Closes-Bug: #1499641
This commit is contained in:
vponomaryov 2016-04-20 13:51:14 +03:00 committed by Valeriy Ponomaryov
parent b27c49d034
commit 7b181981d9
29 changed files with 24 additions and 24 deletions

View File

@ -16,7 +16,7 @@
import ddt
from manila_ui.api import manila as api
from manila_ui.test import helpers as base
from manila_ui.tests import helpers as base
@ddt.ddt

View File

@ -20,7 +20,7 @@ from horizon import forms as horizon_forms
import mock
from manila_ui.dashboards.admin.shares import forms
from manila_ui.test import helpers as base
from manila_ui.tests import helpers as base
@ddt.ddt

View File

@ -16,8 +16,8 @@ from django.core.urlresolvers import reverse
import mock
from manila_ui.api import manila as api_manila
from manila_ui.dashboards.project.shares import test_data
from manila_ui.test import helpers as test
from manila_ui.tests.dashboards.project.shares import test_data
from manila_ui.tests import helpers as test
from openstack_dashboard import api
from openstack_dashboard.usage import quotas

View File

@ -23,9 +23,9 @@ from manilaclient import exceptions as manila_client_exc
import mock
from manila_ui.api import manila as api_manila
from manila_ui.dashboards.project.shares import test_data
from manila_ui.tests.dashboards.project.shares import test_data
from manila_ui.test import helpers as test
from manila_ui.tests import helpers as test
SHARE_INDEX_URL = reverse('horizon:project:shares:index')

View File

@ -19,8 +19,8 @@ from neutronclient.client import exceptions
from manila_ui.api import manila as api_manila
from manila_ui.api import network as api_manila_network
from manila_ui.dashboards.project.shares import test_data
from manila_ui.test import helpers as test
from manila_ui.tests.dashboards.project.shares import test_data
from manila_ui.tests import helpers as test
from openstack_dashboard import api

View File

@ -16,8 +16,8 @@ from django.core.urlresolvers import reverse
import mock
from manila_ui.api import manila as api_manila
from manila_ui.dashboards.project.shares import test_data
from manila_ui.test import helpers as test
from manila_ui.tests.dashboards.project.shares import test_data
from manila_ui.tests import helpers as test
from openstack_dashboard import api
from openstack_dashboard.api import nova

View File

@ -18,7 +18,7 @@ from django.core.handlers import wsgi
import mock
from manila_ui.dashboards.project.shares.snapshots import tables
from manila_ui.test import helpers as base
from manila_ui.tests import helpers as base
@ddt.ddt

View File

@ -16,8 +16,8 @@ from django.core.urlresolvers import reverse
import mock
from manila_ui.api import manila as api_manila
from manila_ui.dashboards.project.shares import test_data
from manila_ui.test import helpers as test
from manila_ui.tests.dashboards.project.shares import test_data
from manila_ui.tests import helpers as test
SHARE_INDEX_URL = reverse('horizon:project:shares:index')

View File

@ -16,8 +16,8 @@ from django.core.urlresolvers import reverse
import mock
from manila_ui.api import manila as api_manila
from manila_ui.dashboards.project.shares import test_data
from manila_ui.test import helpers as test
from manila_ui.tests.dashboards.project.shares import test_data
from manila_ui.tests import helpers as test
from openstack_dashboard import api
from openstack_dashboard.usage import quotas

View File

@ -17,7 +17,7 @@ import ddt
from django.forms import ValidationError # noqa
from manila_ui.dashboards import utils
from manila_ui.test import helpers as base
from manila_ui.tests import helpers as base
@ddt.ddt

View File

@ -17,7 +17,7 @@ from django.utils import unittest
import mock
from manila_ui import api
from manila_ui.test.test_data import utils
from manila_ui.tests.test_data import utils
from openstack_dashboard.test import helpers

View File

@ -33,7 +33,7 @@ STATIC_URL = '/static/'
SECRET_KEY = secret_key.generate_or_read_from_file(
os.path.join(TEST_DIR, '.secret_key_store'))
ROOT_URLCONF = 'manila_ui.test.urls'
ROOT_URLCONF = 'manila_ui.tests.urls'
TEMPLATE_DIRS = (
os.path.join(TEST_DIR, 'templates'),
)

View File

View File

@ -15,7 +15,7 @@ from openstack_dashboard.test.test_data import utils
def load_test_data(load_onto=None):
from manila_ui.test.test_data import keystone_data as manila_keystone_data
from manila_ui.tests.test_data import keystone_data as manila_keystone_data
from openstack_dashboard.test.test_data import exceptions
from openstack_dashboard.test.test_data import keystone_data

View File

@ -165,7 +165,7 @@ function warn_on_flake8_without_venv {
function run_pep8 {
echo "Running flake8 ..."
warn_on_flake8_without_venv
DJANGO_SETTINGS_MODULE=manila_ui.test.settings ${command_wrapper} flake8
DJANGO_SETTINGS_MODULE=manila_ui.tests.settings ${command_wrapper} flake8
}
function run_pep8_changed {
@ -178,13 +178,13 @@ function run_pep8_changed {
files=$(git diff --name-only $base_commit | tr '\n' ' ')
echo "Running flake8 on ${files}"
warn_on_flake8_without_venv
diff -u --from-file /dev/null ${files} | DJANGO_SETTINGS_MODULE=manila_ui.test.settings ${command_wrapper} flake8 --diff
diff -u --from-file /dev/null ${files} | DJANGO_SETTINGS_MODULE=manila_ui.tests.settings ${command_wrapper} flake8 --diff
exit
}
function run_sphinx {
echo "Building sphinx..."
DJANGO_SETTINGS_MODULE=manila_ui.test.settings ${command_wrapper} python setup.py build_sphinx
DJANGO_SETTINGS_MODULE=manila_ui.tests.settings ${command_wrapper} python setup.py build_sphinx
echo "Build complete."
}
@ -331,7 +331,7 @@ function run_tests {
function run_tests_subset {
project=`echo $testargs | awk -F. '{print $1}'`
${command_wrapper} python $root/manage.py test --settings=$project.test.settings $testopts $testargs
${command_wrapper} python $root/manage.py test --settings=$project.tests.settings $testopts $testargs
}
function run_tests_all {
@ -344,7 +344,7 @@ function run_tests_all {
${command_wrapper} python -m coverage.__main__ erase
coverage_run="python -m coverage.__main__ run -p"
fi
${command_wrapper} ${coverage_run} $root/manage.py test manila_ui --settings=manila_ui.test.settings $testopts
${command_wrapper} ${coverage_run} $root/manage.py test manila_ui --settings=manila_ui.tests.settings $testopts
# get results of the Horizon tests
MANILA_UI_RESULT=$?