Commit 13afbf86 authored by Jérome Perrin's avatar Jérome Perrin

fixup! test_json_schema: resolve `request` and `response` schemas

use six for python3 compatibility
parent fe89f1e6
...@@ -25,14 +25,16 @@ ...@@ -25,14 +25,16 @@
# #
############################################################################## ##############################################################################
import unittest import collections
import os
import glob import glob
import json import json
import collections import os
import slapos.test import unittest
import jsonschema import jsonschema
import six
import slapos.test
def createInstanceParameterSchemaValidatorTest(path): def createInstanceParameterSchemaValidatorTest(path):
# Test that json is a valid json schema, supports several # Test that json is a valid json schema, supports several
...@@ -65,7 +67,7 @@ def createSoftwareCfgValidatorTest(path, software_cfg_schema): ...@@ -65,7 +67,7 @@ def createSoftwareCfgValidatorTest(path, software_cfg_schema):
# also make sure request and response schemas can be resolved # also make sure request and response schemas can be resolved
schema.setdefault('$id', 'file://' + path) schema.setdefault('$id', 'file://' + path)
resolver = jsonschema.RefResolver.from_schema(schema) resolver = jsonschema.RefResolver.from_schema(schema)
for software_type_definition in schema['software-type'].itervalues(): for software_type_definition in six.itervalues(schema['software-type']):
resolver.resolve(software_type_definition['request']) resolver.resolve(software_type_definition['request'])
resolver.resolve(software_type_definition['response']) resolver.resolve(software_type_definition['response'])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment