X-Git-Url: https://gerrit.onap.org/r/gitweb?p=dcaegen2%2Fplatform.git;a=blobdiff_plain;f=adapter%2Facumos%2Ftests%2Ftest_spec.py;fp=adapter%2Facumos%2Ftests%2Ftest_spec.py;h=4771a1cae128ac10a41178689ebfb04bf7011196;hp=7f6ec4155ab8ffaab4d405195877603c067c4296;hb=711d4eae913f34e78aa10e8cd511f3b8e43cd54f;hpb=a1a37bde3365ebf0aaa543b2f10ebdb13bd4af40 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",