diff options
author | Andrew Gauld <agauld@att.com> | 2020-07-28 16:41:43 +0000 |
---|---|---|
committer | Andrew Gauld <agauld@att.com> | 2020-07-28 16:43:02 +0000 |
commit | 711d4eae913f34e78aa10e8cd511f3b8e43cd54f (patch) | |
tree | e0bf966addd527a3dd9812c6ed54e2ca0a97a10a /adapter/acumos/tests/test_spec.py | |
parent | a1a37bde3365ebf0aaa543b2f10ebdb13bd4af40 (diff) |
Pull JSON schemas at build/test not run time
Change-Id: I4f095a8a80f1c2868319c58bb0e9db916044d067
Issue-ID: DCAEGEN2-2221
Signed-off-by: Andrew Gauld <agauld@att.com>
Diffstat (limited to 'adapter/acumos/tests/test_spec.py')
-rw-r--r-- | adapter/acumos/tests/test_spec.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/adapter/acumos/tests/test_spec.py b/adapter/acumos/tests/test_spec.py index 7f6ec41..4771a1c 100644 --- a/adapter/acumos/tests/test_spec.py +++ b/adapter/acumos/tests/test_spec.py @@ -1,7 +1,7 @@ # ============LICENSE_START==================================================== # org.onap.dcae # ============================================================================= -# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2019-2020 AT&T Intellectual Property. All rights reserved. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,22 +17,19 @@ # ============LICENSE_END====================================================== from testing_helpers import get_json_fixture, get_fixture_path -from aoconversion import dataformat_gen, spec_gen +from aoconversion import dataformat_gen, spec_gen, utils TEST_META = get_json_fixture("models/example-model/metadata.json") -DRAFT_4_SCHEMA = get_json_fixture("jsdraft4schema.json") -DF_101 = get_json_fixture("dataformat_101.json") -CS_SCHEMA = get_json_fixture("dcae-cli-v2_component-spec-schema.json") -def test_generate_spec(): +def test_generate_spec(mock_schemas): """ Test generating data formats from the protobuf """ test_proto_path = get_fixture_path("models/example-model/model.proto") - data_formats = dataformat_gen._generate_dcae_data_formats(test_proto_path, TEST_META, DF_101, DRAFT_4_SCHEMA) + data_formats = dataformat_gen._generate_dcae_data_formats(test_proto_path, TEST_META, utils.dataformat_schema.get(), utils.schema_schema.get()) assert spec_gen._generate_spec( - "example-model", TEST_META, CS_SCHEMA, data_formats, "nexus01.fake.com:18443/example-model:latest" + "example-model", TEST_META, utils.component_schema.get(), data_formats, "nexus01.fake.com:18443/example-model:latest" ) == { "self": { "version": "1.0.0", |