Remove functionality to load json files
Remove schema loader since all schemas are ported to .py files. Implements: bp api-schema-unification Change-Id: I4b2797798cd5df702b0a7c213f9857b628aa2871
This commit is contained in:
@@ -398,25 +398,6 @@ class NegativeAutoTest(BaseTestCase):
|
||||
service=cls._service)
|
||||
cls.admin_client = os_admin.negative_client
|
||||
|
||||
@staticmethod
|
||||
def load_schema(file_or_dict):
|
||||
"""
|
||||
Loads a schema from a file_or_dict on a specified location.
|
||||
|
||||
:param file_or_dict: just a dict or filename
|
||||
"""
|
||||
# NOTE(mkoderer): we will get rid of this function when all test are
|
||||
# ported to dicts
|
||||
if isinstance(file_or_dict, dict):
|
||||
return file_or_dict
|
||||
|
||||
# NOTE(mkoderer): must be extended for xml support
|
||||
fn = os.path.join(
|
||||
os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
|
||||
"etc", "schemas", file_or_dict)
|
||||
LOG.debug("Open schema file: %s" % (fn))
|
||||
return json.load(open(fn))
|
||||
|
||||
@staticmethod
|
||||
def load_tests(*args):
|
||||
"""
|
||||
@@ -460,7 +441,6 @@ class NegativeAutoTest(BaseTestCase):
|
||||
the data is used to generate query strings appended to the url,
|
||||
otherwise for the body of the http call.
|
||||
"""
|
||||
description = NegativeAutoTest.load_schema(description)
|
||||
LOG.debug(description)
|
||||
generator = importutils.import_class(
|
||||
CONF.negative.test_generator)()
|
||||
@@ -514,7 +494,6 @@ class NegativeAutoTest(BaseTestCase):
|
||||
otherwise for the body of the http call.
|
||||
|
||||
"""
|
||||
description = NegativeAutoTest.load_schema(description)
|
||||
LOG.info("Executing %s" % description["name"])
|
||||
LOG.debug(description)
|
||||
method = description["http-method"]
|
||||
@@ -604,8 +583,6 @@ def SimpleNegativeAutoTest(klass):
|
||||
"""
|
||||
@attr(type=['negative', 'gate'])
|
||||
def generic_test(self):
|
||||
if hasattr(self, '_schema_file'):
|
||||
self.execute(self._schema_file)
|
||||
if hasattr(self, '_schema'):
|
||||
self.execute(self._schema)
|
||||
|
||||
|
Reference in New Issue
Block a user