X-Git-Url: https://gerrit.onap.org/r/gitweb?p=dcaegen2%2Fplatform.git;a=blobdiff_plain;f=adapter%2Facumos%2Ftests%2Fconftest.py;fp=adapter%2Facumos%2Ftests%2Fconftest.py;h=4219f66cef6249f3f7239ee2c8f50a0df19f33fc;hp=80351c82d3556b19f53ecc488064a2ce005938b7;hb=93da1351f5a8e870735f507a74147560c827b179;hpb=1eded3b8420e0c1c72e48f00f18399b7d2142118 diff --git a/adapter/acumos/tests/conftest.py b/adapter/acumos/tests/conftest.py index 80351c8..4219f66 100644 --- a/adapter/acumos/tests/conftest.py +++ b/adapter/acumos/tests/conftest.py @@ -19,7 +19,9 @@ import os import pytest import requests + import aoconversion +from tests import testing_helpers @pytest.fixture @@ -29,3 +31,43 @@ def mock_schemas(monkeypatch): monkeypatch.setattr(aoconversion.utils.component_schema, 'path', schemadir + '/component-specification/dcae-cli-v2/component-spec-schema.json') monkeypatch.setattr(aoconversion.utils.dataformat_schema, 'path', schemadir + '/data-format/dcae-cli-v1/data-format-schema.json') monkeypatch.setattr(aoconversion.utils.schema_schema, 'ret', requests.get('https://json-schema.org/draft-04/schema#').json()) + + +def test_get_metadata(): + model_repo_path = testing_helpers.get_fixture_path('models') + model_name = 'example-model' + assert (aoconversion.utils.get_metadata(model_repo_path, model_name) == { + "schema": "acumos.schema.model:0.4.0", + "runtime": { + "name": "python", + "encoding": "protobuf", + "version": "3.6.8", + "dependencies": { + "pip": { + "indexes": [], + "requirements": [ + { + "name": "dill", + "version": "0.3.0" + }, + { + "name": "acumos", + "version": "0.8.0" + } + ] + }, + "conda": { + "channels": [], + "requirements": [] + } + } + }, + "name": "example-model", + "methods": { + "add": { + "input": "NumbersIn", + "output": "NumberOut", + "description": "Adds two integers" + } + } + })