Add a gitreview and modify for unit-testing

Change-Id: Ib2eb728e092383a81fb2d888842fd2e1b1d7fbe7
This commit is contained in:
Hiroyuki Eguchi 2017-02-01 14:35:05 +09:00
parent 94b9cf4820
commit 40cb671811
7 changed files with 37 additions and 24 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.pyc

4
.gitreview Normal file
View File

@ -0,0 +1,4 @@
[gerrit]
host=review.openstack.org
port=29418
project=openstack/meteos-ui.git

View File

@ -14,8 +14,8 @@
from horizon import exceptions
from horizon.utils.memoized import memoized
import logging
from openstack_dashboard.api import base
from meteosclient.api import client as meteos_client
from openstack_dashboard.api import base
LOG = logging.getLogger(__name__)

View File

@ -26,7 +26,7 @@ class Template(generic.View):
@rest_utils.ajax()
def get(self, request, id):
"""Get a specific template"""
return change_to_id(client.template_show(request, id).to_dict())
return client.template_show(request, id).to_dict()
@urls.register
@ -79,7 +79,7 @@ class Experiment(generic.View):
@rest_utils.ajax()
def get(self, request, id):
"""Get a specific experiment"""
return change_to_id(client.experiment_show(request, id).to_dict())
return client.experiment_show(request, id).to_dict()
@urls.register
@ -132,7 +132,7 @@ class Dataset(generic.View):
@rest_utils.ajax()
def get(self, request, id):
"""Get a specific dataset"""
return change_to_id(client.dataset_show(request, id).to_dict())
return client.dataset_show(request, id).to_dict()
@urls.register
@ -185,7 +185,7 @@ class Model(generic.View):
@rest_utils.ajax()
def get(self, request, id):
"""Get a specific model"""
return change_to_id(client.model_show(request, id).to_dict())
return client.model_show(request, id).to_dict()
@urls.register
@ -238,7 +238,7 @@ class ModelEvaluation(generic.View):
@rest_utils.ajax()
def get(self, request, id):
"""Get a specific model_evaluation"""
return change_to_id(client.model_evaluation_show(request, id).to_dict())
return client.model_evaluation_show(request, id).to_dict()
@urls.register
@ -292,7 +292,7 @@ class Learning(generic.View):
@rest_utils.ajax()
def get(self, request, id):
"""Get a specific learning"""
return change_to_id(client.learning_show(request, id).to_dict())
return client.learning_show(request, id).to_dict()
@urls.register

View File

@ -18,4 +18,5 @@ PANEL_GROUP = 'machine_learning'
PANEL_DASHBOARD = 'project'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'meteos_ui.content.machine_learning.model_evaluations.panel.ModelEvaluations'
ADD_PANEL = 'meteos_ui.content.machine_learning.model_evaluations.panel.\
ModelEvaluations'

View File

@ -22,6 +22,7 @@ HORIZON_CONFIG.pop('default_dashboard', None)
# Update the dashboards with meteos_ui
import openstack_dashboard.enabled
from openstack_dashboard.utils import settings
import meteos_ui.enabled
settings.update_dashboards(

View File

@ -1,5 +1,5 @@
[tox]
envlist = py34,py27,py27dj18,pep8
envlist = py35,py34,py27,py27dj18,pep8
minversion = 2.0
skipsdist = True
@ -18,6 +18,12 @@ deps = -r{toxinidir}/requirements.txt
commands = python manage.py test {posargs} --settings=meteos_ui.test.settings
# Until python-meteosclient released, install from github temporary.
[testenv:py35]
basepython = python3.5
commands =
pip install git+https://github.com/openstack/python-meteosclient.git
python manage.py test {posargs} --settings=meteos_ui.test.settings
[testenv:py27]
basepython = python2.7
commands =