summaryrefslogtreecommitdiffstats
path: root/adapter/acumos/tests/conftest.py
diff options
context:
space:
mode:
authorshabs2020 <shabnam.sultana@highstreet-technologies.com>2021-02-19 15:50:17 +0100
committershabs2020 <shabnam.sultana@highstreet-technologies.com>2021-02-22 16:55:25 +0100
commit93da1351f5a8e870735f507a74147560c827b179 (patch)
treec58b5abdfe5ce9b30e9d2ba07a06cea63845d393 /adapter/acumos/tests/conftest.py
parent1eded3b8420e0c1c72e48f00f18399b7d2142118 (diff)
Improve code coverage of Acumos-DCAE adapter1.0.4-adapter-acumos
Adding and modifying unit test scripts to increase code coverage of the Acumos-DCAE adapter Issue-ID: DCAEGEN2-2633 Signed-off-by: shabs2020 <shabnam.sultana@highstreet-technologies.com> Change-Id: I22e752d8ce33373b3326757594445e0288874b35 Signed-off-by: shabs2020 <shabnam.sultana@highstreet-technologies.com>
Diffstat (limited to 'adapter/acumos/tests/conftest.py')
-rw-r--r--adapter/acumos/tests/conftest.py42
1 files changed, 42 insertions, 0 deletions
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"
+ }
+ }
+ })