diff options
Diffstat (limited to 'adapter/acumos/tests/test_df.py')
-rw-r--r-- | adapter/acumos/tests/test_df.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/adapter/acumos/tests/test_df.py b/adapter/acumos/tests/test_df.py index cdf41c4..3872f35 100644 --- a/adapter/acumos/tests/test_df.py +++ b/adapter/acumos/tests/test_df.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,23 +17,21 @@ # ============LICENSE_END====================================================== from testing_helpers import get_json_fixture, get_fixture_path -from aoconversion import dataformat_gen +from aoconversion import dataformat_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") def test_get_needed_formats(): assert dataformat_gen._get_needed_formats(TEST_META) == ["NumbersIn", "NumberOut"] -def test_generate_dcae_data_formats(): +def test_generate_dcae_data_formats(mock_schemas): """ Test generating data formats from the protobuf """ test_proto_path = get_fixture_path("models/example-model/model.proto") - assert dataformat_gen._generate_dcae_data_formats(test_proto_path, TEST_META, DF_101, DRAFT_4_SCHEMA) == [ + assert dataformat_gen._generate_dcae_data_formats(test_proto_path, TEST_META, utils.dataformat_schema.get(), utils.schema_schema.get()) == [ { "self": {"name": "NumbersIn", "version": "1.0.0"}, "dataformatversion": "1.0.1", @@ -62,14 +60,14 @@ def test_generate_dcae_data_formats(): ] -def test_generate_dcae_data_formats_listofm(): +def test_generate_dcae_data_formats_listofm(mock_schemas): """ Test generating data formats from the protobuf This one tests the case where definitions needs to be populated in one of the data formats because it's referenced in a "top level" message """ test_meta = get_json_fixture("models/example-model-listofm/metadata.json") test_proto_path = get_fixture_path("models/example-model-listofm/model.proto") - assert dataformat_gen._generate_dcae_data_formats(test_proto_path, test_meta, DF_101, DRAFT_4_SCHEMA) == [ + assert dataformat_gen._generate_dcae_data_formats(test_proto_path, test_meta, utils.dataformat_schema.get(), utils.schema_schema.get()) == [ { "self": {"name": "ArgsList", "version": "1.0.0"}, "dataformatversion": "1.0.1", |