diff options
author | Andrew Gauld <agauld@att.com> | 2020-07-28 16:41:43 +0000 |
---|---|---|
committer | Andrew Gauld <agauld@att.com> | 2020-07-28 16:43:02 +0000 |
commit | 711d4eae913f34e78aa10e8cd511f3b8e43cd54f (patch) | |
tree | e0bf966addd527a3dd9812c6ed54e2ca0a97a10a /mod/onboardingapi/dcae_cli/catalog/mock/tests/test_schema.py | |
parent | a1a37bde3365ebf0aaa543b2f10ebdb13bd4af40 (diff) |
Pull JSON schemas at build/test not run time
Change-Id: I4f095a8a80f1c2868319c58bb0e9db916044d067
Issue-ID: DCAEGEN2-2221
Signed-off-by: Andrew Gauld <agauld@att.com>
Diffstat (limited to 'mod/onboardingapi/dcae_cli/catalog/mock/tests/test_schema.py')
-rw-r--r-- | mod/onboardingapi/dcae_cli/catalog/mock/tests/test_schema.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/mod/onboardingapi/dcae_cli/catalog/mock/tests/test_schema.py b/mod/onboardingapi/dcae_cli/catalog/mock/tests/test_schema.py index 90674d9..9270268 100644 --- a/mod/onboardingapi/dcae_cli/catalog/mock/tests/test_schema.py +++ b/mod/onboardingapi/dcae_cli/catalog/mock/tests/test_schema.py @@ -1,7 +1,7 @@ # ============LICENSE_START======================================================= # org.onap.dcae # ================================================================================ -# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-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. @@ -394,6 +394,8 @@ def test_validate(): good_path = "/correct_path" + goodschema = schema._Schema(good_path) + goodschema.ret = fake_schema def fetch_schema(path): if path == good_path: return fake_schema @@ -404,18 +406,20 @@ def test_validate(): good_instance = { "foo": "hello", "bar": 1776 } - schema._validate(fetch_schema, good_path, good_instance) + schema._validate(goodschema, good_instance) # Error from validating bad_instance = {} with pytest.raises(DcaeException): - schema._validate(fetch_schema, good_path, bad_instance) + schema._validate(goodschema, bad_instance) # Error from fetching bad_path = "/wrong_path" + badschema = schema._Schema(bad_path) + with pytest.raises(DcaeException): - schema._validate(fetch_schema, bad_path, good_instance) + schema._validate(badschema, good_instance) |