X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=adapter%2Facumos%2Ftests%2Ftest_fed.py;h=c5400a3cefc7b69dd23fd58b6403de5d0c1779bc;hb=93da1351f5a8e870735f507a74147560c827b179;hp=4d3636fa8d892dca4ec9d18965cc09642423cdba;hpb=849da15d5b7ddc68e4c2b90b603fc8948d4b5e6d;p=dcaegen2%2Fplatform.git diff --git a/adapter/acumos/tests/test_fed.py b/adapter/acumos/tests/test_fed.py index 4d3636f..c5400a3 100644 --- a/adapter/acumos/tests/test_fed.py +++ b/adapter/acumos/tests/test_fed.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. @@ -19,7 +19,6 @@ import json import requests -from testing_helpers import get_json_fixture as get_test_json from testing_helpers import get_fixture_path as get_test_file from aoconversion import docker_gen as aoc_docker_gen @@ -157,11 +156,6 @@ _mockwebdata = { 'https://acumos/artifacts/a2/content': _r(file=get_test_file('models/example-model/model.proto')), 'https://acumos/artifacts/a3/content': _r(data=b'dummy zip archive data'), 'https://acumos/artifacts/a4/content': _r(file=get_test_file('models/example-model/metadata.json')), - 'http://json-schema.org/draft-04/schema#': _r(get_test_json('jsdraft4schema.json')), - 'https://gerrit.onap.org/r/gitweb?p=dcaegen2/platform/cli.git;a=blob_plain;f=component-json-schemas/data-format/dcae-cli-v1/data-format-schema.json;hb=HEAD': _r(get_test_json('dataformat_101.json')), - 'http://dcaeurl//component-json-schemas/data-format/dcae-cli-v1/data-format-schema.json': _r(get_test_json('dataformat_101.json')), - 'https://gerrit.onap.org/r/gitweb?p=dcaegen2/platform/cli.git;a=blob_plain;f=component-json-schemas/component-specification/dcae-cli-v2/component-spec-schema.json;hb=HEAD': _r(get_test_json('dcae-cli-v2_component-spec-schema.json')), - 'http://dcaeurl//component-json-schemas/component-specification/dcae-cli-v2/component-spec-schema.json': _r(get_test_json('dcae-cli-v2_component-spec-schema.json')), } @@ -170,7 +164,7 @@ _mockwebdata = { # -def test_aoconversion(tmpdir, monkeypatch): +def test_aoconversion(mock_schemas, tmpdir, monkeypatch): config = aoc_scanner.Config(dcaeurl='http://dcaeurl', dcaeuser='dcaeuser', onboardingurl='https://onboarding', onboardinguser='obuser', onboardingpass='obpass', acumosurl='https://acumos', certfile=None, dockerregistry='dockerregistry', dockeruser='registryuser', dockerpass='registrypassword') monkeypatch.setattr(aoc_docker_gen, 'APIClient', _mockdocker.APIClient) monkeypatch.setattr(requests, 'get', _mockwww(_mockwebdata)) @@ -178,3 +172,8 @@ def test_aoconversion(tmpdir, monkeypatch): monkeypatch.setattr(requests, 'patch', _mockwww(_mockpatchdata)) aoc_scanner.scan(config) aoc_scanner.scan(config) + + +def test__derefconfig(): + config_path = get_test_file('config.yaml') + assert aoc_scanner._derefconfig('@' + config_path) == 'dcaeurl: https://git.onap.org/dcaegen2/platform/plain/mod'