Port admin metering tests to Python 3
Replace json with oslo_serialization Change-Id: I065bf68b55fca28481ae760dc4e9ba3c5822c3e0 Partial-Implements: blueprint porting-python3
This commit is contained in:
parent
d8aaa41b91
commit
3e675d5ed3
@ -9,7 +9,6 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
import json
|
|
||||||
|
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django import http
|
from django import http
|
||||||
@ -17,6 +16,8 @@ from django import http
|
|||||||
from mox3.mox import IsA # noqa
|
from mox3.mox import IsA # noqa
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
from oslo_serialization import jsonutils
|
||||||
|
|
||||||
from openstack_dashboard import api
|
from openstack_dashboard import api
|
||||||
from openstack_dashboard.test import helpers as test
|
from openstack_dashboard.test import helpers as test
|
||||||
from openstack_dashboard.test.test_data import utils as test_utils
|
from openstack_dashboard.test.test_data import utils as test_utils
|
||||||
@ -63,7 +64,7 @@ class MeteringLineChartTabTests(test.BaseAdminViewTests):
|
|||||||
test_utils.load_test_data(self.testdata)
|
test_utils.load_test_data(self.testdata)
|
||||||
|
|
||||||
def _verify_series(self, series, value, date, expected_names):
|
def _verify_series(self, series, value, date, expected_names):
|
||||||
data = json.loads(series)
|
data = jsonutils.loads(series)
|
||||||
self.assertTrue('series' in data)
|
self.assertTrue('series' in data)
|
||||||
self.assertEqual(len(data['series']), len(expected_names))
|
self.assertEqual(len(data['series']), len(expected_names))
|
||||||
for d in data['series']:
|
for d in data['series']:
|
||||||
|
1
tox.ini
1
tox.ini
@ -23,6 +23,7 @@ commands = /bin/bash run_tests.sh -N --no-pep8 {posargs}
|
|||||||
commands =
|
commands =
|
||||||
python manage.py test --settings=horizon.test.settings horizon.test.tests
|
python manage.py test --settings=horizon.test.settings horizon.test.tests
|
||||||
python manage.py test --settings=openstack_dashboard.test.settings \
|
python manage.py test --settings=openstack_dashboard.test.settings \
|
||||||
|
openstack_dashboard.dashboards.admin.metering \
|
||||||
openstack_dashboard.contrib.sahara.content.data_processing.data_sources.tests \
|
openstack_dashboard.contrib.sahara.content.data_processing.data_sources.tests \
|
||||||
openstack_dashboard.contrib.sahara.content.data_processing.job_binaries.tests \
|
openstack_dashboard.contrib.sahara.content.data_processing.job_binaries.tests \
|
||||||
openstack_dashboard.contrib.sahara.content.data_processing.jobs.tests \
|
openstack_dashboard.contrib.sahara.content.data_processing.jobs.tests \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user