diff --git a/magnum_ui/api/rest/__init__.py b/magnum_ui/api/rest/__init__.py index e69de29b..4d5a6643 100644 --- a/magnum_ui/api/rest/__init__.py +++ b/magnum_ui/api/rest/__init__.py @@ -0,0 +1,16 @@ +# Copyright 2016 Cisco Systems +# +# 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 REST modules here +from . import magnum # noqa diff --git a/magnum_ui/content/clusters/views.py b/magnum_ui/content/clusters/views.py index 14b01884..6ea33c5a 100644 --- a/magnum_ui/content/clusters/views.py +++ b/magnum_ui/content/clusters/views.py @@ -14,10 +14,6 @@ from django.views import generic -# DO NOT REMOVE -# This needs for register url of API. -from magnum_ui.api.rest import magnum # noqa - class IndexView(generic.TemplateView): template_name = 'angular.html' diff --git a/magnum_ui/enabled/__init__.py b/magnum_ui/enabled/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/magnum_ui/test/api_tests/__init__.py b/magnum_ui/test/api_tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/magnum_ui/test/settings.py b/magnum_ui/test/settings.py new file mode 100644 index 00000000..82e9d228 --- /dev/null +++ b/magnum_ui/test/settings.py @@ -0,0 +1,39 @@ +# Copyright 2016 Cisco Systems, Inc. +# +# 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. + +# Default to Horizons test settings to avoid any missing keys +from horizon.test.settings import * # noqa +from openstack_dashboard.test.settings import * # noqa + +# pop these keys to avoid log warnings about deprecation +# update_dashboards will populate them anyway +HORIZON_CONFIG.pop('dashboards', None) +HORIZON_CONFIG.pop('default_dashboard', None) + +# Update the dashboards with magnum_ui +import magnum_ui.enabled +import openstack_dashboard.enabled +from openstack_dashboard.utils import settings + +settings.update_dashboards( + [ + magnum_ui.enabled, + openstack_dashboard.enabled, + ], + HORIZON_CONFIG, + INSTALLED_APPS +) + +# Ensure any duplicate apps are removed after the update_dashboards call +INSTALLED_APPS = list(set(INSTALLED_APPS)) diff --git a/setup.cfg b/setup.cfg index 2fce48f2..4a79c92c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,3 +21,8 @@ classifier = [files] packages = magnum_ui + +[build_sphinx] +all_files = 1 +build-dir = doc/build +source-dir = doc/source diff --git a/tox.ini b/tox.ini index 3af6c264..635df6f4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py27dj18,pep834 +envlist = py27,py27dj18,pep8,py34 minversion = 1.6 skipsdist = True @@ -11,42 +11,28 @@ setenv = VIRTUAL_ENV={envdir} NOSE_OPENSTACK_RED=0.05 NOSE_OPENSTACK_YELLOW=0.025 NOSE_OPENSTACK_SHOW_ELAPSED=1 -# Note the hash seed is set to 0 until horizon can be tested with a -# random hash seed successfully. - PYTHONHASHSEED=0 install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -U {opts} {packages} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -commands = /bin/bash run_tests.sh -N --no-pep8 {posargs} +commands = python manage.py test {posargs} --settings=magnum_ui.test.settings [testenv:pep8] -commands = - /bin/bash run_tests.sh -N --pep8 - /bin/bash run_tests.sh -N --makemessages --check-only +commands = flake8 {posargs} [testenv:venv] commands = {posargs} [testenv:cover] -commands = /bin/bash run_tests.sh -N --no-pep8 --coverage {posargs} +commands = python setup.py test --coverage --testr-args='{posargs}' [testenv:py27dj18] basepython = python2.7 -commands = pip install django>=1.8,<1.9 - /bin/bash run_tests.sh -N --no-pep8 {posargs} - -[testenv:py27integration] -basepython = python2.7 -commands = /bin/bash run_tests.sh -N --integration --selenium-headless {posargs} - -[testenv:eslint] -passenv = * -commands = nodeenv -p - npm install - /bin/bash run_tests.sh -N --eslint +commands = + pip install django>=1.8,<1.9 + python manage.py test {posargs} --settings=magnum_ui.test.settings [testenv:docs] -setenv = DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings +setenv = DJANGO_SETTINGS_MODULE=magnum_ui.test.settings commands = python setup.py build_sphinx [flake8]