Browse Source

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
changes/65/308265/4
vponomaryov 6 years ago
committed by Valeriy Ponomaryov
parent
commit
7b181981d9
  1. 0
      manila_ui/tests/__init__.py
  2. 0
      manila_ui/tests/api/__init__.py
  3. 2
      manila_ui/tests/api/test_manila.py
  4. 0
      manila_ui/tests/dashboards/__init__.py
  5. 0
      manila_ui/tests/dashboards/admin/__init__.py
  6. 0
      manila_ui/tests/dashboards/admin/shares/__init__.py
  7. 2
      manila_ui/tests/dashboards/admin/shares/test_forms.py
  8. 4
      manila_ui/tests/dashboards/admin/shares/tests.py
  9. 0
      manila_ui/tests/dashboards/project/__init__.py
  10. 0
      manila_ui/tests/dashboards/project/shares/__init__.py
  11. 0
      manila_ui/tests/dashboards/project/shares/security_services/__init__.py
  12. 4
      manila_ui/tests/dashboards/project/shares/security_services/tests.py
  13. 0
      manila_ui/tests/dashboards/project/shares/share_networks/__init__.py
  14. 4
      manila_ui/tests/dashboards/project/shares/share_networks/tests.py
  15. 0
      manila_ui/tests/dashboards/project/shares/shares/__init__.py
  16. 4
      manila_ui/tests/dashboards/project/shares/shares/tests.py
  17. 0
      manila_ui/tests/dashboards/project/shares/snapshots/__init__.py
  18. 2
      manila_ui/tests/dashboards/project/shares/snapshots/test_tables.py
  19. 4
      manila_ui/tests/dashboards/project/shares/snapshots/tests.py
  20. 0
      manila_ui/tests/dashboards/project/shares/test_data.py
  21. 4
      manila_ui/tests/dashboards/project/shares/tests.py
  22. 2
      manila_ui/tests/dashboards/test_utils.py
  23. 2
      manila_ui/tests/helpers.py
  24. 2
      manila_ui/tests/settings.py
  25. 0
      manila_ui/tests/test_data/__init__.py
  26. 0
      manila_ui/tests/test_data/keystone_data.py
  27. 2
      manila_ui/tests/test_data/utils.py
  28. 0
      manila_ui/tests/urls.py
  29. 10
      run_tests.sh

0
manila_ui/test/__init__.py → manila_ui/tests/__init__.py

0
manila_ui/test/api/__init__.py → manila_ui/tests/api/__init__.py

2
manila_ui/test/api/test_manila.py → manila_ui/tests/api/test_manila.py

@ -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

0
manila_ui/test/dashboards/__init__.py → manila_ui/tests/dashboards/__init__.py

0
manila_ui/test/dashboards/admin/__init__.py → manila_ui/tests/dashboards/admin/__init__.py

0
manila_ui/test/dashboards/admin/shares/__init__.py → manila_ui/tests/dashboards/admin/shares/__init__.py

2
manila_ui/test/dashboards/admin/shares/test_forms.py → manila_ui/tests/dashboards/admin/shares/test_forms.py

@ -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

4
manila_ui/dashboards/admin/shares/tests.py → manila_ui/tests/dashboards/admin/shares/tests.py

@ -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

0
manila_ui/test/dashboards/project/__init__.py → manila_ui/tests/dashboards/project/__init__.py

0
manila_ui/test/dashboards/project/shares/__init__.py → manila_ui/tests/dashboards/project/shares/__init__.py

0
manila_ui/test/dashboards/project/shares/snapshots/__init__.py → manila_ui/tests/dashboards/project/shares/security_services/__init__.py

4
manila_ui/dashboards/project/shares/security_services/tests.py → manila_ui/tests/dashboards/project/shares/security_services/tests.py

@ -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')

0
manila_ui/test/test_data/__init__.py → manila_ui/tests/dashboards/project/shares/share_networks/__init__.py

4
manila_ui/dashboards/project/shares/share_networks/tests.py → manila_ui/tests/dashboards/project/shares/share_networks/tests.py

@ -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

0
manila_ui/tests/dashboards/project/shares/shares/__init__.py

4
manila_ui/dashboards/project/shares/shares/tests.py → manila_ui/tests/dashboards/project/shares/shares/tests.py

@ -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

0
manila_ui/tests/dashboards/project/shares/snapshots/__init__.py

2
manila_ui/test/dashboards/project/shares/snapshots/test_tables.py → manila_ui/tests/dashboards/project/shares/snapshots/test_tables.py

@ -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

4
manila_ui/dashboards/project/shares/snapshots/tests.py → manila_ui/tests/dashboards/project/shares/snapshots/tests.py

@ -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')

0
manila_ui/dashboards/project/shares/test_data.py → manila_ui/tests/dashboards/project/shares/test_data.py

4
manila_ui/dashboards/project/shares/tests.py → manila_ui/tests/dashboards/project/shares/tests.py

@ -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

2
manila_ui/test/dashboards/test_utils.py → manila_ui/tests/dashboards/test_utils.py

@ -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

2
manila_ui/test/helpers.py → manila_ui/tests/helpers.py

@ -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

2
manila_ui/test/settings.py → manila_ui/tests/settings.py

@ -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'),
)

0
manila_ui/tests/test_data/__init__.py

0
manila_ui/test/test_data/keystone_data.py → manila_ui/tests/test_data/keystone_data.py

2
manila_ui/test/test_data/utils.py → manila_ui/tests/test_data/utils.py

@ -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

0
manila_ui/test/urls.py → manila_ui/tests/urls.py

10
run_tests.sh

@ -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=$?

Loading…
Cancel
Save